首页
微信
安卓
接口
移动
前端
专题
文档库
工具
网址
§
ITPOW
>>
文档
>>
JavaScript
>>
鼠标键盘
为页面设置热键
作者:chilleen 来源:
ITPOW
日期:2004-10-8
本页面的热键为[c]试试按[c]键你会看到什么? <script language=""> <!-- var travel=true var hotkey=99 /* hotkey即为热键的键值,是ASII码,这里99代表c键 */ if (document.layers) document.captureEvents(Event.KEYPRESS) function gogo(e) { if (document.layers) { if (e.which==hotkey&&travel) window.close() } else if (document.all){ if (event.keyCode==hotkey) window.close() } } document.onkeypress=gogo --> </script>
[Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]
相关文章
创建于2005年
渝ICP备05010272号-1
电邮:
cftea@126.com
即将跳转...