Skip to content Skip to sidebar Skip to footer

Keyboard Arrow Keys Navigation With Easy Slider 1.7

I'm trying to edit the Easy Slider to allow the keyboard's arrow keys to navigate the slideshow. I tried editing the javascript's animate function from: default: t = dir; break; .

Solution 1:

Assuming your next and prev links have IDs of #next and #prev:

$(document).keydown(function(e){
    if (e.keyCode == 39) { 
       $('a#next').trigger('click');
    }

    elseif (e.keyCode == 37) {
         $('a#prev').trigger('click');
    }
});

I'm also not familiar with easy slider, but if they have a way to programmatically switch the slides back and forth, then you could swap out the triggers with those. The posted solution will work fine though.

Post a Comment for "Keyboard Arrow Keys Navigation With Easy Slider 1.7"