javascript - Trigger jCarouselLite on keypress -
I'm using a tabbed navigation to create a navigation element, but I want to trigger it I left and right scrolls on a keypace, can it be done without modifying jCarouselLite code? Thanks!
Using the default settings, the button contains the class .prev
And .next
then why not try to trigger clicks on them?
function myFunction () {$ (".prev"). Trigger ("click"); }
If you pass options in the buttons or in your own sections, you can bind them instead.
This example would be when you left and right keyboard key:
$ (document) .keyup (function (e) {var code = (e.keyCode? E Kikode: EHH; Switch (code) {Case 37: $ (".") Trigger ("click"); brake; // left case 39: $ ("next.") Trigger ("Click"); brake; // true}});
Comments
Post a Comment