zoukankan      html  css  js  c++  java
  • 页面无刷新超时自动退出

    <%
    Seven_OverTime=10 '超时自动退出的时间,单位是分钟
    %>
    <script>
    var JumpUrl = "",JumpTimer = 10;
    var TimerCount = 0,Timer,IsStopJump = false;
    var TimerOut = <%=Seven_OverTime*60%>;
    function $(_sId){return document.getElementById(_sId);}
    function SetAutoJumpUrl(timers,url){JumpTimer = timers;JumpUrl = url;Timer = setTimeout("AutoJumpUrl()",1100);}
    function AutoJumpUrl(){
       if(IsStopJump) return;
       if(TimerCount<(JumpTimer-1)){
        TimerCount ++;
        $('CountDown').innerText = JumpTimer-TimerCount;
        setTimeout("AutoJumpUrl()",1100);
       }else {
        document.location.href = JumpUrl;
       }
    }
    function HandJump(){
       if(IsStopJump == false){
        IsStopJump = true;
        $('DoStop').innerText="y";
        $('DoStop').title="恢复倒计时";
       }else{
        IsStopJump = false;
        $('DoStop').innerText="x";
        $('DoStop').title="停止倒计时";
        AutoJumpUrl();
       }
    }
    </script>
    <body onmousemove="TimerCount=0;" onmouseover="TimerCount=0;" onkeydown="TimerCount=0;" onclick="TimerCount=0;" onmouseout="TimerCount=0;" onFocus="TimerCount=0;">
    <font id="DoStop" face="Wingdings" onclick="HandJump();" style="cursor:hand;" title="停止倒计时">x</font>
    <span id="CountDown"><script>document.write (TimerOut);</script></span>秒后自动退出
    <script>SetAutoJumpUrl(TimerOut,"http://www.7di.net");</script>
    </body>
  • 相关阅读:
    一些简单的问题
    WebRTC的 windows 7 环境搭建
    HTML常用标签
    参考C#编程规范
    C#窗体调用(转载)
    java中的小知识(不断更行中。。。。。)
    CF1483E Vabank 题解
    CF755G PolandBall and Many Other Balls 题解
    CF1483D Useful Edges 题解
    CF1368F Lamps on a Circle 题解
  • 原文地址:https://www.cnblogs.com/see7di/p/2240013.html
Copyright © 2011-2022 走看看