Created
April 5, 2011 16:47
-
-
Save amedrz/903979 to your computer and use it in GitHub Desktop.
key events with jQuery.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function(){ | |
$(document).keydown(function(event){ | |
switch(event.which){ | |
case 13: | |
alert("enter"); | |
break; | |
case 39: | |
alert("right-arrow"); | |
break; | |
case 37: | |
alert("left-arrow"); | |
break; | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment