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");      }   } }); 

fiddle live


Comments

Popular posts from this blog

drupal - using views argument in the view tpl.php file -

php - Posting PHPBB Forum Thread/Post info in a website -

php - Add a blog by sending a mail to a certain emailadress -