/ Published in: jQuery
This is just a basic example of how you would allow navigation via left/right arrow keys. This is most commonly used when navigating multiple-image image galleries.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
jQuery(document).keydown(function(e){ if (e.which == 37) { // 37 is the left arrow key code. window.location.href = 'http://www.url.com'; }; if (e.which == 39) { // 39 is the right arrow key code. window.location.href = 'http://www.url.com'; }; });