码迷,mamicode.com
首页 > 其他好文 > 详细

倒计时跳转

时间:2014-10-09 18:11:37      阅读:101      评论:0      收藏:0      [点我收藏+]

标签:style   blog   color   io   ar   java   sp   div   art   

在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>

 

倒计时跳转

标签:style   blog   color   io   ar   java   sp   div   art   

原文地址:http://www.cnblogs.com/manusas/p/4013348.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!