Hi, I used your code but still it's the same problem: If the box
appears the up and down keys will do nothing.
It would be nice, if you take a quick look at
http://igf-project.igf.uos.de/~bhempen/index_tomaten.html where you
can see the problem.
regards
m.sirin
On 11 Jan., 01:27, Šime Vidas wrot
Actually, this is right...
$().keydown(function(e) {
var $item = $(".selected");
if (e.keyCode === 40) { // bottom
if ($item.next().is("li")) {
$item.removeClass("selected").next
().addClass("selected");
The code above is wrong... here:
$().keydown(function(e) {
var $item = $(".selected").removeClass("selected");
if (e.keyCode === 40) { // bottom
if ($item.next().is("li")) {
$item.next().addClass("selected");
the html section looks like:
Hi1
Hi2
Hi3
and then I added Sime Vidas code:
$(document).ready(function() {
$("#autoSuggestionsList :first").addClass("selected");
$().keydown(function(
Okay, thank you.
But I dont know how to iterate through the values of
#autoSuggestionsList. They are like
Hello1
Hello2
Like this? if (#autoSuggestionsList.next().is("li")) {
'#autoSuggestionsList.next().addClass
("selected");
...
I forgot to mention: don't get freaked out by the code... basically
what you need is:
$().keydown(function(e) {
if (e.keyCode === 40) {
// down cursor key was pressed
} else if (e.keyCode === 38) {
// up cursor key was pre
Here ...
http://vidasp.net/jquery-example8.html
7 matches
Mail list logo