JQuery CyclePluging next prev click event on keypress

How can I show the next previous pages when I press the left or right arrow?

http://jsfiddle.net/9Ntrz/

$(document.documentElement).keyup(function (e) {

    if (e.keyCode == 39)
    {
        ???
    }

    if (e.keyCode == 37)
    {
        ???
    }

});

      

+3


source to share


1 answer


Just use a loop ('command'):

$(document.documentElement).keyup(function (e) {
    if (e.keyCode == 39)
    {        
       $('#slideshow').cycle('next');
    }

    if (e.keyCode == 37)
    {
        $('#slideshow').cycle('prev');
    }

});

      



More details here

+6


source







All Articles