分类: 系统运维
2012-11-13 10:11:51
function favorate(){
if(confirm("提示:恭喜您成为奇侠第二批进游戏的贵宾,随手收藏本站下回方便来领奖哦!")){
window.external.AddFavorite('','点击就可玩,免费游戏平台--奇侠游戏娱乐平台')
}
}
window.onbeforeunload = function() {
var n = window.event.screenX - window.screenLeft;
var b = n > document.documentElement.scrollWidth-20;
if(b && window.event.clientY
< 0 || window.event.altKey) {
//alert("是关闭而非刷新");
//window.open(this.location);
favorate();
//return false;
//window.event.returnValue = ""; }
} else{
//alert("是刷新而非关闭");
}
}
页面head里加入这段js就行了,body里面不用加相关事件