一段倒计秒代码
作者:刚子 日期:2008-12-29
<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>
<!--
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>
评论: 0 | 引用: 0 | 查看次数: -
发表评论
上一篇
下一篇

文章来自:
Tags: