您的位置:首页 > Web前端 > JavaScript

js 关闭页面时,弹出窗口

2013-05-16 10:10 260 查看
关闭页面时,弹出窗口。只ie。

/****** popup a window while closing*****/
window.onbeforeunload = function (){
openWin("b.html","",520,380);
//alert("close");
if (event.clientX < document.body.clientWidth && event.clientY<0 ||event.altKey){
//alert("close.........");
}else{
//alert("flush");
}
}


/***** open window *****/
function openWin(url,title,width,height){
//titlebar=0,toolbar=0,menubar=0
window.open(url,title,"width="+width+",height="+height+",top=200,left=350");
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: