<script language="javascript">
window.onbeforeunload = function() //author: meizz
{
var n = window.event.screenX - window.screenLeft;
var b = n > document.documentElement.scrollWidth-20;
if(b && window.event.clientY < 0 || window.event.altKey)
{
window.event.returnValue = ""; //这里可以放置你想做的操作代码
}
}
</script>
window.onbeforeunload = function() //author: meizz
{
var n = window.event.screenX - window.screenLeft;
var b = n > document.documentElement.scrollWidth-20;
if(b && window.event.clientY < 0 || window.event.altKey)
{
window.event.returnValue = ""; //这里可以放置你想做的操作代码
}
}
</script>
可以解释一下么?谢谢。
function window.onbeforeunload()
{
if (event.clientX>document.body.clientWidth && event.clientY<0 || event.altKey){
window.event.returnValue="是否真的要关闭窗口!";
}
//在这里写上你要的操作;
}
</script>
非常感谢