接收键盘指令的脚本


按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>

按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>


« 
» 
快速导航

Copyright © 2016 phpStudy | 豫ICP备2021030365号-3