无操作后执行事件

2020-03-05  本文已影响0人  回忆不死我们不散
<html>
<head>
<title></title>
<meta charset="UTF-8"/>     
</head>
<body>
    
        
</body>
<script>
    var time;
    var n = 9*1000;
    time = setTimeout(function(){
        location.href="https://www.baidu.com";
    },n);
    window.top.document.onmousemove=function(){
        clearTimeout(time);
        time = setTimeout(function(){
            location.href="https://www.baidu.com";
        },n);
    }
    window.top.document.onkeydown=function(){
        clearTimeout(time);
        time = setTimeout(function(){
            location.href="https://www.baidu.com";
        },n);
    }
</script>


</html>
上一篇下一篇

猜你喜欢

热点阅读