What are the key codes for the right and left arrow keys?
What are the key codes for the righ开发者_开发技巧t and left arrow keys?
Left: 37, Right: 39.
Discovery of other keycodes can be done with the following code:
$('body').keyup(function (event) {
console.log(event.keyCode);
});
Which will output the keycode to the console when you press any key.
left key - 37
right key - 39
精彩评论