zoukankan      html  css  js  c++  java
  • 自动定时跳转

     1<script language="javascript" type="text/javascript">
     2var HongYiOvertime=58;
     3var HongYiStartDate=new Date(); 
     4var HongYiUpLineDate = HongYiStartDate.setMinutes(HongYiStartDate.getMinutes()+HongYiOvertime);
     5document.onmousedown=DoMouseDown;
     6//document.onmousemove=DoMouseMove;
     7//document.onmouseout=DoMouseOut;
     8document.onmouseup=DoMouseUp;
     9document.onkeydown=DoKeyDown;
    10function DoMouseDown()
    11{
    12   var crrutDate = new Date();
    13   HongYiUpLineDate = crrutDate.setMinutes(crrutDate.getMinutes()+HongYiOvertime);
    14}

    15function DoMouseMove()
    16{
    17   var crrutDate = new Date();
    18   HongYiUpLineDate = crrutDate.setMinutes(crrutDate.getMinutes()+HongYiOvertime);
    19}

    20function DoMouseOut()
    21{
    22   var crrutDate = new Date();
    23   HongYiUpLineDate = crrutDate.setMinutes(crrutDate.getMinutes()+HongYiOvertime);
    24}

    25function DoMouseUp()
    26{
    27   var crrutDate = new Date();
    28   HongYiUpLineDate = crrutDate.setMinutes(crrutDate.getMinutes()+HongYiOvertime);
    29}

    30function DoKeyDown()
    31{
    32   var crrutDate = new Date();
    33   HongYiUpLineDate = crrutDate.setMinutes(crrutDate.getMinutes()+HongYiOvertime);
    34}

    35function HongYiSetGoLogin()
    36{
    37//  var dateObj = new Date();
    38    var divObj = document.getElementById('div1_stratDate');
    39    var crrentDate=new Date(); 
    40
    41    if(((HongYiUpLineDate.valueOf()-crrentDate.valueOf())/60000)< 0)
    42    {
    43        divObj.innerText='当前时间:'+crrentDate.toLocaleString()+'['+(HongYiUpLineDate.valueOf()-crrentDate.valueOf())/1000+']秒后将跳转到登录页面';
    44        window.location='http://192.168.4.10/aqwebTest/'
    45    }

    46    divObj.innerText='当前时间:'+crrentDate.toLocaleString()+'['+(HongYiUpLineDate.valueOf()-crrentDate.valueOf())/1000+']秒后将跳转到登录页面';
    47   
    48}

    49window.setInterval('HongYiSetGoLogin()', 600);
    50        </script>
  • 相关阅读:
    ASP.NET MVC EF4.1
    RabbitMQ Boot Step
    图书商城项目总论
    CodeSharp.EventSourcing框架介绍如何实现异步事件订阅
    asp.net的cms 原理篇
    异步编程:线程概述及使用
    2012
    CodeSharp.EventSourcing框架介绍
    最近开发的一个文档管理系统
    团队项目开发
  • 原文地址:https://www.cnblogs.com/wubiyu/p/807292.html
Copyright © 2011-2022 走看看