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 <george.adam...@softwareunity.com> wrote: > 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 along the lines of... > var prevOrNext = e.keyCode == 37 ? -1 : e.keyCode == 39 ? 1 : 0; > if( prevOrNext ){ > var $list = $(this).parents("SELECT"); > var selIndex = $list.attr("selectedIndex") + prevOrNext; > location.href = $list.find("OPTION").eq(selIndex).val(); > > } > > I dare say you can slim the code down a little! > > George > > > problem is I am using <optgroup> too and can't find a way to make it > > work