Last active
May 9, 2018 13:53
-
-
Save ahmedghazi/b3db00f57235feea0746ec63155a3686 to your computer and use it in GitHub Desktop.
keyboard events
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
```javascript | |
$(document).keyup(function (event) { | |
//console.log(event.keyCode) | |
switch(event.keyCode){ | |
case 27: | |
$(".dialog-close").click() | |
break; | |
case 39: | |
$(".controls.next").click() | |
break; | |
case 37: | |
$(".controls.prev").click() | |
break; | |
} | |
}); | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment