本帖最后由 wtoeb 于 2010-05-06 02:05:59 编辑

解决方案 »

  1.   

    页面的mousedown和 keydown注册个事件 setInterval('Go',3000)val gointerval=setInterval('Go',3000);function Go()
    {
      location='/';
    }
      

  2.   

    对了,每一次用户mousedown或者keydown的时候要重置这个interval
      

  3.   


    setTimeout("test('http://www.baidu.com')", 30000);
    function test(str){
        window.location = str;
    }
      

  4.   

    <script type="text/javascript">
        ss = setInterval("keyDown();", 10000);
        function keyDown(event) {
            
            if (window.event) {
                //处理函数
                window.clearInterval(ss);
            }
            else {
                if (confirm("您已经10秒钟没有操作,即将跳到首页,确定?")) {
                    document.location.href = "/";
                }
            }
        }
        document.onkeydown = keyDown; 
    </script>
      

  5.   

    var delay=30*1000,
    timer=setTimeout('location="/"',delay);document.onclick=document.onkeydown=function(){
      clearTimeout(timer);//有动作时清除上一次的计时器
      timer=setTimeout('location="/"',delay);//重新计时
    }
      

  6.   


    这么写才对 event 要判断浏览器, 搂住可以试一试