<script language=javascript>
function window.onbeforeunload()
{
if ((event.clientX>document.body.clientWidth) && (event.clientY<0||event.altKey))
{
alert("关闭");
}
}
//--
</script>
function window.onbeforeunload()
{
if ((event.clientX>document.body.clientWidth) && (event.clientY<0||event.altKey))
{
alert("关闭");
}
}
//--
</script>
主要是针对XP的
调用这个事件。
XP下的浏览器也是浏览器,一样的
<head>
<script language=javascript>
function window.onbeforeunload()
{
if ((event.clientX>document.body.clientWidth) && (event.clientY<0||event.altKey))
{
alert("欢迎下次再来喔!");
}
}
//--
</script>
</head>
<body>
测试,关闭窗体的效果!
</body>
</html>