zoukankan      html  css  js  c++  java
  • js页面打开倒计时

    <!--这里定义倒计时开始数值-->

    <span id="totalSecond">5</span>

     <!--定义js变量及方法-->

    <script language="javascript" type="text/javascript">
    var second = document.getElementById('totalSecond').textContent;

    if (navigator.appName.indexOf("Explorer") > -1)
    {
    second = document.getElementById('totalSecond').innerText;
    } else
    {
    second = document.getElementById('totalSecond').textContent;
    }


    setInterval("redirect()", 1000);
    function redirect()
    {
    if (second < 0)
    {

     <!--定义倒计时后跳转页面-->
    location.href = 'default.aspx';
    } else
    {
    if (navigator.appName.indexOf("Explorer") > -1)
    {
    document.getElementById('totalSecond').innerText = second--;
    } else
    {
    document.getElementById('totalSecond').textContent = second--;
    }
    }
    }
    </script>

  • 相关阅读:
    每日日报
    每日日报
    JAVA日报
    JAVA日报
    JAVA日报
    JAVA日报
    NavigationDuplicated {_name: "NavigationDuplicated", name: "NavigationDuplicated"}
    2020.11.07
    2020.11.05
    2020.11.09
  • 原文地址:https://www.cnblogs.com/songqiaoli/p/2572104.html
Copyright © 2011-2022 走看看