I get it to work now, just change the selector "window" to "document", The IE really has no idea what "window" is LOL.
The working code $(document).keydown(function(e){ if(e.which == 37){ $('.prev').click();} else if(e.which == 39){ $('.next').click();} }); On May 23, 8:34 am, runrunforest <craigco...@gmail.com> wrote: > its IE 7 > > On May 22, 9:13 pm, "ryan.j" <ryan.joyce...@googlemail.com> wrote: > > > possibly keycode vs. charcode. did you try the keypress thingy on > > quirksmode to see what IE returns on keydown? > > > which version of IE isn't it working? > > > On May 22, 3:10 pm, runrunforest <craigco...@gmail.com> wrote: > > > > thanks > > > > I got this to work in all browser except... IE. > > > > The code i used > > > > $(window).keydown(function(e){ > > > if(e.which == 37){ $('.prev').click();} > > > else if(e.which == 39){ $('.next').click();} > > > }); > > > > What makes IE not understand this ? > > > > On May 22, 3:15 pm, "ryan.j" <ryan.joyce...@googlemail.com> wrote: > > > > > take a look here ->http://www.quirksmode.org/js/keys.html > > > > > 37: left > > > > 38: up > > > > 39: right > > > > 40: down > > > > > irritatingly, i completely forgot the arrow keys are a special case, > > > > and won't trigger properly (or even consistently) the keypress event > > > > across different browsers. try keydown or keyup to catch the charcode, > > > > > On May 22, 5:19 am, runrunforest <craigco...@gmail.com> wrote: > > > > > > the all the arrow has charcode of "0" (zero). I know this by the code > > > > > > var key = e.which; > > > > > alert(key); > > > > > > So how the script which is right arrow which is left arrow. > > > > > > On May 21, 10:51 pm, "ryan.j" <ryan.joyce...@googlemail.com> wrote: > > > > > > > yeah, stick this in document ready. > > > > > > > to simulate the click, get the id of element you'd normally click to > > > > > > advance the scroller (inspect it with the mozilla plugin firebug) > > > > > > and > > > > > > append .click() > > > > > > > On May 21, 4:45 pm, runrunforest <craigco...@gmail.com> wrote: > > > > > > > > could you give some further tip, how can I simulate, where should > > > > > > > I > > > > > > > put the code to (document.ready part ?). > > > > > > > > On May 21, 10:28 pm, "ryan.j" <ryan.joyce...@googlemail.com> > > > > > > > wrote: > > > > > > > > > $(window).keypress(function (e) { > > > > > > > > if (e.which == 39 ) { > > > > > > > > /* keypress right */ > > > > > > > > } elseif (e.which == 37 ) { > > > > > > > > /* keypress left */ > > > > > > > > } else { > > > > > > > > return false; > > > > > > > > } > > > > > > > > > }); > > > > > > > > > if you can't figure out how to advance the cycle on your own, > > > > > > > > maybe > > > > > > > > try to simulate $('#scrollLeft').click() > > > > > > > > > On May 21, 2:48 am, runrunforest <craigco...@gmail.com> wrote: > > > > > > > > > > In cycle plugin, ss there way to switch images by keyboard > > > > > > > > > arrows > > > > > > > > > instead of clicking "next, prev"