页面导航: 首页网络编程JavaScript → 正文内容

接收键盘指令的脚本

发布:dxy 字体:[增加 减小] 类型:转载

按A就会跳转到地图名片的网页,请按A
<SCRIPT language="JavaScript">
<!--
var hotkey=97
var destination="http://mc.mapabc.com"
if (document.layers)
document.captureEvents(Event.KEYPRESS)
function backhome(e){
if (document.layers){
if (e.which==hotkey)
window.location=destination
}
else if (document.all){
if (event.keyCode==hotkey)
window.location=destination
}
}
document.onkeypress=backhome

 

onkeydown="javascript:onenter();"

function onenter(){
 if(event.keyCode==13){
alert("回车");
}
}
</SCRIPT>

浏览次数:载入中... 打印本文关闭本文返回首页
·在百度中搜索关于“接收键盘指令的脚本”相关内容
·在谷歌中搜索关于“接收键盘指令的脚本”相关内容

文章评论

共有 位脚本之家网友发表了评论我来说两句

同 类 文 章
最 近 更 新
热 点 排 行