Open jcarol16 opened 9 years ago
I've had success with this (note, this requires adding the html for the prev/next buttons, and the extra .prev and .next classes in that html):
$(document).keydown(function(e) {
var prev = $('.zoomButton.prev');
var next = $('.zoomButton.next');
switch(e.which) {
case 37: // left
$('.zoomButton.prev').trigger('click');
break;
case 38: // up
break;
case 39: // right
$('.zoomButton.next').trigger('click');
break;
case 40: // down
break;
default: return; // exit this handler for other keys
}
e.preventDefault(); // prevent the default action (scroll / move caret)
});
Hello, I need to navigate between areas via the keyboard. (key left and right arrows).