JS网页定时自动关闭-无浏览器提示-ScreenSaver.prototype.timeout(2)


<html>    
<head>    
<script type="text/javascript">
var timerID;
var nTimeout;  
var saver;
/**
 * 初始化
 **/
function onload(){       
 document.body.onmousemove = ScreenSaver.prototype.onevent;    
 document.body.onmousedown = ScreenSaver.prototype.onevent;    
 document.body.onkeydown = ScreenSaver.prototype.onevent;    
 document.body.onkeypress = ScreenSaver.prototype.onevent;
 //创建关闭事件
  //saver = new ScreenSaver();
}
/**
 * 鼠标单击事件
 **/          
//document.οnmοusedοwn= function(){
 
//}
ScreenSaver.prototype.onevent = function(e){
 //鼠标单击事情-根据序列ID清空事件
  window.clearTimeout(timerID);
  //重新创建关闭事件 
  saver = new ScreenSaver();
}
/**
 * 调用关闭事件方法体
 **/ 
function ScreenSaver(){
 //初始化参数:5000毫秒=5秒      
    nTimeout = 5000;
    //返回序列ID
    timerID = window.setTimeout(f, nTimeout);  
}
/**
 * 获取过时对象
 **/
var f = function(){ 
     //获取当前超时对象
     ScreenSaver.prototype.timeout();
}
/**
 * 初始化超时对象
 **/    
ScreenSaver.prototype.timeout = function(){
/*  window.opener = "whocares";
 var browserName=navigator.appName;
 if (browserName=="Netscape")
 {
  window.open('','_parent','');
  window.close();
 }
 else if (browserName=="Microsoft Internet Explorer")
 {
  window.opener = "whocares";
  window.close();
 }  */
 window.close();   
}    
</script>    
    </head>    
    <body οnlοad="onload();">    
  </p>5秒不动就跳转    
    </body>    
</html>
07-07 14:44:01.144 1936 3340 W ActivityManager: Force finishing activity com.zhiying.settings/.about.LegalInformationActivity 07-07 14:44:01.152 1936 1936 E PowerManagerService: screensaver enable true 07-07 14:44:01.166 1936 1952 E memtrack: Couldn't load memtrack module 07-07 14:44:01.166 1936 1952 W android.os.Debug: failed to get memory consumption info: -1 07-07 14:44:01.215 1936 2009 W InputDispatcher: channel '5cfd4ab com.zhiying.settings/com.zhiying.settings.about.LegalInformationStartWebActivity (server)' ~ Consumer closed input channel or an error occurred. events=0x9 07-07 14:44:01.215 1936 2009 E InputDispatcher: channel '5cfd4ab com.zhiying.settings/com.zhiying.settings.about.LegalInformationStartWebActivity (server)' ~ Channel is unrecoverably broken and will be disposed! 07-07 14:44:01.215 1936 2009 W InputDispatcher: channel 'c486525 com.zhiying.settings/com.zhiying.settings.about.LegalInformationStartWebActivity (server)' ~ Consumer closed input channel or an error occurred. events=0x9 07-07 14:44:01.215 1936 2009 E InputDispatcher: channel 'c486525 com.zhiying.settings/com.zhiying.settings.about.LegalInformationStartWebActivity (server)' ~ Channel is unrecoverably broken and will be disposed! 07-07 14:44:01.216 1936 2009 W InputDispatcher: channel 'b3becb6 com.zhiying.settings/com.zhiying.settings.about.LegalInformationActivity (server)' ~ Consumer closed input channel or an error occurred. events=0x9 07-07 14:44:01.216 1936 2009 E InputDispatcher: channel 'b3becb6 com.zhiying.settings/com.zhiying.settings.about.LegalInformationActivity (server)' ~ Channel is unrecoverably broken and will be disposed! 07-07 14:44:01.216 1936 2009 W InputDispatcher: channel '1712ca6 com.zhiying.settings/com.zhiying.settings.about.SystemInfoActivity (server)' ~ Consumer closed input channel or an error occurred. events=0x9 07-07 14:44:01.216 1936 2009 E InputDispatcher: channel '1712ca6 com.zhiying.settings/com.zhiying.settings.about.SystemInfoActivity (server)' ~ Channel is unrecoverably broken and will be disposed! 07-07 14:44:01.216 1936 2009 W InputDispatcher: channel 'd7b4fb2 com.zhiying.settings/com.zhiying.settings.MainZYActivity (server)' ~ Consumer closed input channel or an error occurred. events=0x9 07-07 14:44:01.217 1936 2009 E InputDispatcher: channel 'd7b4fb2 com.zhiying.settings/com.zhiying.settings.MainZYActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
07-08
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值