jquery - Keyboard events -
how call click
event of link, when keyboard button pressed?
i call next/previous page on ctrl + → / ctrl + ←
$(document).keydown(function(e) { if(e.ctrlkey){ if(e.keycode == 37){ //ctrl + leftbutton pressed $("a.prevbutton").trigger("click"); }else if(e.keycode == 39){ //ctrl + rightbutton pressed $("a.nextbutton").trigger("click"); } } });
Comments
Post a Comment