欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

Web相关

程序员文章站 2022-09-10 15:00:33
(1)Web常见控件介绍 https://www.cnblogs.com/hanke123/p/5940595.html (2)JS无鼠标键盘操作时跳转页面 (3)CSS书写规范 https://www.cnblogs.com/Lxb98117/p/W3c-norm.html ......

(1)web常见控件介绍

(2)js无鼠标键盘操作时跳转页面

<html>   
<head>   
<script type="text/javascript">   
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 = 'http://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});   
}   

function window.onload(){   
  initscreensaver();   
}   

</script>   
    </head>   
    <body>   
</p>5秒不动就跳转   
    </body>   
</html>  

(3)css书写规范

https://www.cnblogs.com/lxb98117/p/w3c-norm.html