一段倒计秒代码

<script type="text/javascript">
    <!--
    var duration=10000;
    var endTime = new Date().getTime() + duration + 100;
    function interval()
    {
        var n=(endTime-new Date().getTime())/1000;
        if(n<0) return;
        document.getElementById("timeout").innerHTML = n.toFixed(0);
        setTimeout(interval, 10);
    }
    window.onload=function()
    {
        setTimeout("window.location.href='http://community.csdn.net/homepage.aspx'", duration);
        interval();
    }
    //-->
</script>
系统在<span id="timeout"></span> 秒后 将自动跳转到<a href="http://community.csdn.net/homepage.aspx">社区首页</a>



文章来自: 本站原创
引用通告: 查看所有引用 | 我要引用此文章
Tags:
相关日志:
评论: 0 | 引用: 0 | 查看次数: -
发表评论
昵 称:
密 码: 游客发言不需要密码.
内 容:
验证码: 验证码
选 项:
虽然发表评论不用注册,但是为了保护您的发言权,建议您注册帐号.
t