如何制作倒计时器?
当用户加载页面时,时钟开始倒计时,到达时间后,它将浏览器重定向到新页面。
找到这个了,不太好用。http://encosia.com/2007/07/25/display-data-updates-in-real-time-with-ajax/
像这样的东西吗?
<div id="countDiv"></div>
<script>
function countDown (count) {
if (count > 0) {
var d = document.getElementById("countDiv");
d.innerHTML = count;
setTimeout (function() { countDown(count-1); }, 1000);
}
else
document.location = "someotherpage.html";
}
countDown(5);
</script>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)