藍森林首頁 | 返回主頁 | 本站地圖 | 站內搜索 | 聯繫信箱 |
 您目前的位置:首頁 > 自由軟件 > 技術交流 > 應用編程


    

藍森林 http://www.lslnet.com 2006年8月25日 8:28

能不能在javascript代碼的循環語句中插入暫停

也就是說,讓每次循環時停頓一下再進入下一次循環。

setTimeout就可以實現了

看個例子, 這種句式一般在函數[color=red]中[/color]引用另一個函數, 函數被綁定了計時器:
[html]
<script>
function a1(){
alert("Information No.1");
setTimeout("a2()",2000);
}
function a2(){
alert("Information No.2");
setTimeout("alert('看到效果了嗎?')",2000);
}
a1();
</script>
[/html]





Copyright © 1999-2000 LSLNET.COM. All rights reserved. 藍森林網站 版權所有。 E-mail : webmaster@lslnet.com