找回密码
 入学

QQ登录

只需一步,快速开始

查看: 910|回复: 0

接收键盘指令的脚本

[复制链接]
发表于 2008-11-18 14:37:49 | 显示全部楼层 |阅读模式
  1. 按A就会跳转到娃娃亲的网页,请按A
  2. <SCRIPT language="JavaScript">
  3. <!--
  4. var hotkey=97
  5. var destination="http://www.wawaqin.com"
  6. if (document.layers)
  7. document.captureEvents(Event.KEYPRESS)
  8. function backhome(e){
  9. if (document.layers){
  10. if (e.which==hotkey)
  11. window.location=destination
  12. }
  13. else if (document.all){
  14. if (event.keyCode==hotkey)
  15. window.location=destination
  16. }
  17. }
  18. document.onkeypress=backhome
  19. onkeydown="javascript:onenter();"
  20. function onenter(){
  21. if(event.keyCode==13){
  22. alert("回车");
  23. }
  24. }
  25. </SCRIPT>
复制代码
您需要登录后才可以回帖 登录 | 入学

本版积分规则

QQ|Archiver|手机版|小黑屋|校园天空成立于2004年2月24日 ( 陕ICP备08000078号-8 )

GMT+8, 2025-5-11 02:42 , Processed in 0.092590 second(s), 17 queries .

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表