50分钟无操作退出网站
//定时跳转
var x;window.onload = init; function init() { //设置,页面载入完毕之后,1秒不懂鼠标就页面就会跳转
x = setTimeout(function () {
$.Send("Core/Leave", {}, function (result) {
if (result.success) {
window.location.href = decodeURI(result.msg);
}
else {
parent.layer.msg(decodeURI(result.msg));
}
});
}, 50 * 60000); //鼠标在网页上移动调用moved函数
document.onmousemove = moved;
} function moved() { //既然鼠标移动了,取消页面跳转
clearTimeout(x); //从现在开始重新计时,如果到了1秒还是要跳转
x = setTimeout(function () {
$.Send("Core/Leave", {}, function (result) {
if (result.success) {
window.location.href = decodeURI(result.msg);
}
else {
parent.layer.msg(decodeURI(result.msg));
}
});
}, 50 * 60000);
}