[jQuery] Re: jQuery next() to find

2009-04-28 Thread dimitre
ACE Solution! Thanks more compact than this would be: works with keydown event too. do you think I'll have some problem with browser, etc? navigation is working with keyboard here: http://dmtr.org/ On Apr 28, 12:10 pm, George Adamson wrote: > Are you able to use the keyup event instead or does

[jQuery] Re: jQuery next() to find

2009-04-28 Thread George Adamson
Are you able to use the keyup event instead or does it need to be keydown? (Inside the keyup event handler the option:selected item should be the one you're after, instead of having to derive it.) Failing that could you just find the next/previous option by using selectedIndex +/-1 ? Something

[jQuery] Re: jQuery next() to find

2009-04-27 Thread Remon Oldenbeuving
Try changing .val() into .text() or .html() On 27 apr 2009, at 22:51, dimitre wrote: thanks for the quick answer, unfortunately no, I can't understand why but it returns "undefined" On Apr 27, 5:37 pm, Remon Oldenbeuving wrote: hi, $(document).keydown (function(e) {

[jQuery] Re: jQuery next() to find

2009-04-27 Thread dimitre
thanks for the quick answer, unfortunately no, I can't understand why but it returns "undefined" On Apr 27, 5:37 pm, Remon Oldenbeuving wrote: > hi, > >        $(document).keydown (function(e) { >                if (e.keyCode == 37) >                        if(n == $('select > option:selected').

[jQuery] Re: jQuery next() to find

2009-04-27 Thread Remon Oldenbeuving
hi, $(document).keydown (function(e) { if (e.keyCode == 37) if(n == $('select option:selected').prev('option').val()) location.href = n; if (e.keyCode == 39) if(n == $('select option: