日期:2014-05-16 浏览次数:20404 次
var PageTimeCounter = 0; //初始化页面挂机时间倒计时
var ShutdownCounter = 0; //初始化提示窗口关闭倒计时
var PageTime = 900; //定义页面弹出关闭信息时间,单位秒
var ShutdownTime = 300; //定义关闭信息持续时间,单位秒
var MsgStatus = "hide"; //初始化弹出消息显示状态
var ShowPop; //显示弹出消息
var HidePop; //隐藏弹出消息
function ready() {
var PopMessage = document.getElementById("PopMessage");
$(document).mousemove(function () { ChangeToMaskLess(); if (MsgStatus == "hide") { PageTimeCounter = 0; ShutdownCounter = 0; }; });
document.getElementById('PopMessage').style.height = '0px';
setInterval('ChangeToMask()', 5000);
setInterval('CheckPageTime();', 1000);
}
function ChangeToMask() {//启用遮罩层,To-Hack-iframe
var MaskDivZindex = document.getElementById("MaskDiv");
MaskDivZindex.style.zIndex = "0";
}
function ChangeToMaskLess() {//禁用遮罩层,To-Control-iframe
var MaskDivZindex = document.getElementById("MaskDiv");
MaskDivZindex.style.zIndex = -100;
}
function CheckPageTime() {
if (PageTimeCounter < PageTime)
PageTimeCounter++;
else
PageTimeCounter = PageTime;
$('#show').text(PageTime - PageTimeCounter); //页面挂机时间倒计时
$('#ShowShutdownCounter').text(ShutdownTime - ShutdownCounter); //关闭当前浏览器窗口倒计时,以秒显示
$('#PageTime').text((PageTime / 60).toFixed(0)); //页面挂机时间设定值,以分钟显示
if (PageTimeCounter >= PageTime) {
Show_Notice();
}
}
function ShutdownPage() {
ShutdownCounter++;
if (ShutdownCounter >= ShutdownTime) {
Exit();
}
}
function Exit() {//强制关闭当前浏览器窗口
window.opener = null; window.open("", '_self', ""); window.close();
}
function Show_Notice() {
var PopMessage = document.getElementById("PopMessage");
var popH = parseInt(PopMessage.style.height); //将对象的高度转化为数字
PopMessage.style.display = "block";
ShowPop = setInterval("changeH('up')", 20);
ShutdownPage();
}
function Close_Notice() {
PageTimeCounter = 0;
ShutdownCounter = 0;
var PopMessage = document.getElementById("PopMessage");
var popH = parseInt(PopMessage.style.height); //将对象的高度转化为数字
PopMessage.style.display = "block";