function ScreenSaver(settings){     

        this.settings = settings;     

        this.nTimeout = this.settings.timeout;     

        document.body.screenSaver = this;
// link in to body events
document.body.onmousemove = ScreenSaver.prototype.onevent;
document.body.onmousedown = ScreenSaver.prototype.onevent;
document.body.onkeydown = ScreenSaver.prototype.onevent;
document.body.onkeypress = ScreenSaver.prototype.onevent; var pThis = this;
var f = function(){pThis.timeout();}
this.timerID = window.setTimeout(f, this.nTimeout);
}
ScreenSaver.prototype.timeout = function(){
if ( !this.saver ){
window.location = 'www.baidu.com';
}
}
ScreenSaver.prototype.signal = function(){
if ( this.saver ){
this.saver.stop();
} window.clearTimeout(this.timerID); var pThis = this;
var f = function(){pThis.timeout();}
this.timerID = window.setTimeout(f, this.nTimeout);
} ScreenSaver.prototype.onevent = function(e){
this.screenSaver.signal();
} var saver;
function initScreenSaver(){
//blort;
saver = new ScreenSaver({timeout:5000}); //无动作时间
}
window.onload = function(){
initScreenSaver();
}

JS监听页面----无鼠标键盘动作,自动跳页的更多相关文章

  1. js监听页面放大缩小

    <!DOCTYPE html><html> <head> <meta charset="utf-8"> <title>d ...

  2. JS监听页面关闭

    JS可以监听浏览器页面的关闭,主要使用了window对象的onbeforeunload方法 在以前(旧版本的浏览器中),可以自定义提示文案 window.onbeforeunload = functi ...

  3. 使用python监听、模拟鼠标键盘事件

    最近守望职业选手疑似开挂事件挺热闹的,在下小菜一枚,并不能从视频中看出端倪.看了一些关于外挂的讨论,自动点射和压枪只需在鼠标驱动上做些改动即可,自瞄或其他高级功能则需要读内存或修改游戏文件,检测也更容 ...

  4. js监听页面是否在浏览器当前页面

    在最近的一个socket项目中,需要监听客户端是否已读客服端发送的消息. 这里用到了html5中document新增了一个事件 visibilitychange,这个事件在页面前台或后台切换时被触发, ...

  5. JS监听页面滚动到底部事件

    废话不说,直接上代码,放心我这个是最好的,直接放到js脚本里,直接生效: $(window).scroll(function(){ var scrollTop = $(this).scrollTop( ...

  6. js 监听页面url锚点变化 window.onpopstate

    window.onpopstate = function (event) { if (location.href.indexOf('#') == -1) { location.reload(); } ...

  7. js监听页面copy事件添加版权信息

    个人博客 地址:http://www.wenhaofan.com/article/20180921103346 1.介绍 当页面需要做版权保护时,比如当用户copy我们网站的文章时,我们会希望在他co ...

  8. js监听页面标签切换

    var OriginTitile = document.title, titleTime; document.addEventListener('visibilitychange', function ...

  9. js中对arry数组的各种操作小结 瀑布流AJAX无刷新加载数据列表--当页面滚动到Id时再继续加载数据 web前端url传递值 js加密解密 HTML中让表单input等文本框为只读不可编辑的方法 js监听用户的键盘敲击事件,兼容各大主流浏览器 HTML特殊字符

    js中对arry数组的各种操作小结   最近工作比较轻松,于是就花时间从头到尾的对js进行了详细的学习和复习,在看书的过程中,发现自己平时在做项目的过程中有很多地方想得不过全面,写的不够合理,所以说啊 ...

随机推荐

  1. springboot 利用configureMessageConverters add FastJsonHttpMessageConverter 实现返回JSON值 null to ""

    /** * 文件名:@WebConfiguration.java <br/> * @author tomas <br/> import com.alibaba.fastjson ...

  2. 针对MSHFlexGrid的一系列通用方法-项目中实践代码分享

    1.给MSHFlexGrid填充数据通用方法 '自定义报表填充程序 fgrid Public Function ShowformfData(Resultset As ADODB.Recordset, ...

  3. HBase随机读写

    HDFS不太适合做大量的随机读应用,但HBASE却特别适合随机的读写 个人理解: 1.数据库一般都会有一层缓存,任何对数据的更改实际上是先更改内存中的数据.然后有异步的守护进程负责将脏页按照一定策略刷 ...

  4. 【Android开发】交互界面布局详解

    原文:http://android.eoe.cn/topic/summary Android 的系统 UI 为构建您自己的应用提供了基础的框架.主要包括主屏幕 (Home Screen).系统 UI ...

  5. 2. Apache Axis2 快速学习手册之概览

    这篇博文和大家一起学习下Apache Axis2 官方文档的快速指南篇 英文原文:http://axis.apache.org/axis2/java/core/docs/quickstartguide ...

  6. 深入理解Linux内核-进程

    1.进程的静态特性 进程:程序执行时的一个实例 进程描述符(task_struct): 进程的基本信息(thread_info).指向内存区描述符的指针(mm_struct).进程相关的tty(tty ...

  7. 内网ip范围

    局域网可使用的网段(私网地址段)有三大段:10.0.0.0~10.255.255.255(A类)172.16.0.0~172.31.255.255(B类)192.168.0.0~192.168.255 ...

  8. [Windows Azure] Configuring and Deploying the Windows Azure Email Service application - 2 of 5

    Configuring and Deploying the Windows Azure Email Service application - 2 of 5 This is the second tu ...

  9. [Windows Azure] .NET Multi-Tier Application Using Storage Tables, Queues, and Blobs - 1 of 5

    .NET Multi-Tier Application Using Storage Tables, Queues, and Blobs - 1 of 5 This tutorial series sh ...

  10. 【ARM】2440裸机系列-gpio按键控制

    功能 通过GPIO,实现按键1点亮LED1,按键2点亮LED2…… 说明 1)因为2440的按键只涉及行,所以在扫描按键时比2410简单了很多 2)在进行移位操作之前,必须进行数据寄存器的初始化,否则 ...