I am following a tutorial [here][1] to make a Facebook like friend tagging system. But the tutorial lacks the "arrow navigating" capability like Facebook. I would like to figure out how to achieve this.
Basically, when I input text on the contenteditable area, it will generate divs of suggested friends like the following:
<div class="display_box">
<img src="user_img/John.jpg">
<a target='_blank' href="#" class="addname" title="John">John</a><br>
<span>India</span>
</div>
<div class="display_box">
<img src="user_img/Peter.jpg">
<a target='_blank' href="#" class="addname" title="Peter">Peter</a><br>
<span>USA</span>
</div>
<div class="display_box">
<img src="user_img/Mary.jpg>
<a target='_blank' href="#" class="addname" title="Mary">Mary</a><br>
<span>UK</span>
</div>
They are all divs with the class name display_box
. I can click on the box and select them by:
$('div').on("click",".display_box",function(e) {
// do the stuffs
});
I would like my users to be able to use the keyboard, using key up or key down to navigate between the selections, and use the enter key to trigger the selection. Any ideas how can I make this happen? Many thanks!
I am using Trisquel 7.0. I've some basic knowledge about html and JavaScript. Now I want to save html form data to file (Also interested in loading/filling html form from file). I searched and found ...
I am using Trisquel 7.0. I've some basic knowledge about html and JavaScript. Now I want to save html form data to file (Also interested in loading/filling html form from file). I searched and found ...
Setup: leftItems & rightItems are arrays of 5 digit ID's. matchedItems is an array of all those ID's - there a lots of results with the same ID. $matches is a div to which I want to append results ...
Setup: leftItems & rightItems are arrays of 5 digit ID's. matchedItems is an array of all those ID's - there a lots of results with the same ID. $matches is a div to which I want to append results ...
I'm trying to display the time it takes a function to complete in javascript, and then display the time in an alert window that is called on button click, however the alert box doesn't pop up at all ...
I'm trying to display the time it takes a function to complete in javascript, and then display the time in an alert window that is called on button click, however the alert box doesn't pop up at all ...
I have a html table with a row that looks like: <tr> <td><input type="checkbox" name="check[]" value="265"></td> <td>265</td> <td>NO MATCH</...
I have a html table with a row that looks like: <tr> <td><input type="checkbox" name="check[]" value="265"></td> <td>265</td> <td>NO MATCH</...