首页 > 代码库 > 倒计时跳转

倒计时跳转

在html界面里面添加<div id="div1"></div>即可

<script type="text/javascript">    var start = 5;    var step = -1;    function count() {        document.getElementById("div1").innerHTML = "页面在" + start                + "秒后返回录入页面";        start += step;        if (start <= 0) {            start = 5;             window.location = "regist.jsp";//重定位          }        setTimeout("count()", 1000);    }    window.onload = count;</script>

 

倒计时跳转