$(document).keypress(function(e) { switch(e.which) { // user presses the "a" case 97: showViaKeypress("#home"); break; // user presses the "s" key case 115: showViaKeypress("#about"); break; // user presses the "d" key case 100: showViaKeypress("#contact"); break; // user presses the "f" key case 102: showViaKeypress("#awards"); break; // user presses the "g" key case 103: showViaKeypress("#links"); } });
jquery 键盘事件
最新推荐文章于 2024-01-21 20:09:39 发布