function showdiv(){
document.getElementById(“bg”).style.display =”block”;
document.getElementById(“show”).style.display =”block”;
// window.location = “http://www.baidu.com”
}
function hidediv() {
document.getElementById(“bg”).style.display =’none’;
document.getElementById(“show”).style.display =’none’;
}
function keyUp(e) {
var currKey=0,e=e||event;
currKey=e.keyCode||e.which||e.charCode;
var keyName = String.fromCharCode(currKey)
// alert(“esc: ” + currKey + ” 字符: ” + keyName);
if (currKey==27) {
document.getElementById(“bg”).style.display =’none’;
document.getElementById(“show”).style.display =’none’;
}
};
document.onkeyup = keyUp;
js绑定键盘Esc键隐藏模块
最新推荐文章于 2022-08-31 13:03:07 发布