<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="text/javascript">
โค้ด: เลือกทั้งหมด
<script type="text/javascript">
var posx;var posy;
$(window).bind('beforeunload', function(e){
posx=window.pageXOffset;
posy=window.pageYOffset;
if (posy <= 0)
{
doUnload();
}
});
function doUnload()
{
Alert ("exit");
}
</script>
<body>
</body>
</html>