我在一个页面调用了ONKEYDOWN如下, 其中这里面有<iframe src="test.php" width="100%" height="550" frameborder="0" scrolling="yes" allowtransparency="true" style="margin:0;padding:0" ></iframe>
当焦点在iframe里时,document.onkeydown将不起作用
function document.onkeydown(){
if (window.event.altKey || event.keyCode==115||window.event.ctrlKey ||window.event.shiftKey){
alert("系统不支持你使用热键!");
event.returnValue=false;
}
if (window.event.altKey && event.keyCode==115){
alert("系统不支持你使用热键!");
event.returnValue=false;
}
}
当焦点在iframe里时,document.onkeydown将不起作用
function document.onkeydown(){
if (window.event.altKey || event.keyCode==115||window.event.ctrlKey ||window.event.shiftKey){
alert("系统不支持你使用热键!");
event.returnValue=false;
}
if (window.event.altKey && event.keyCode==115){
alert("系统不支持你使用热键!");
event.returnValue=false;
}
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货