Tag:
倒计
| 记录数: 1
-
- 简单的JS倒计秒
- Weather:晴 西南风3-4级 (8~15)℃
- 2007-11-05
在网上看了一些,太复杂了,discuz!的那个注册倒计时再是复杂,得用着吗?用下面我写的这个就easy come,easy go了。
function onSecond(i) {
if (i == 0) {
//do something ,like alert("hello world")
return;
}
document.getElementById("").innerText = i;
window.setTimeout("onSecond("+(parseInt(i)-1)+")",1000);
}
window.onload = onSecond(5);怎么样?简单明了吧?
- Views(5176) | Comments(0) | In 网页前端技术
