给网页加上热键

2008-11-10 11:36:00 | 【
按“A”键,页面将跳转

按“A”键,页面将跳转到指定的网页,只能在IE中运行

查看全部代码 View Code

在网页<body>区添加以下代码

按“A”键,页面将跳转

<SCRIPT language="JavaScript">
<!--
var hotkey=97
var destination="http://www.sharejs.com";
if (document.layers)
document.captureEvents(Event.KEYPRESS)
function Helpor_net(e){
if (document.layers){
if (e.which==hotkey)
window.location=destination;
}
else if (document.all){
if (event.keyCode==hotkey)
window.location=destination;
}
}
document.onkeypress=Helpor_net;
//-->


</SCRIPT>

下载"给网页加上热键 "

  • 本地下载
  • 本地下载2

相关资源