$(document).keydown(function(e) { //window.event.returnValue = false; //alert("KeyCode:" + e.keyCode); if (e.which == 13) { if (window.event)//for IE window.event.returnValue = false; else//for Firefox e.returnValue = false; var num = parseInt($("#JumpTo").val()); if (!checkPageRange(num)) return false; $("#PageCurrent").val(num); $("form:first").submit(); } else if (e.which == 37) { var num = parseInt($("#PageCurrent").val()) - 1; if (!checkPageRange(num)) return false; $("#PageCurrent").val(num); $("form:first").submit(); } else if (e.which == 39) { var num = parseInt($("#PageCurrent").val()) + 1; if (!checkPageRange(num)) return false; //alert("paging" + num); $("#PageCurrent").val(num); $("form:first").submit(); } }); keypress事件不能捕捉左键和右键
jquery 键盘事件捕捉
最新推荐文章于 2022-07-27 09:26:01 发布