代码不见得是最优的写法,在网速慢的时候可能会有延时,欢迎批评指正:)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
<script language=
"javascript"
>
var
count = 1;
addEvent(window,
"load"
, diamond);
function
diamond() {
setTimeout(
"setInterval(setImage, 50)"
,2000);
}
function
setImage() {
document.images.diamond.src =
"http://images.cnblogs.com/cnblogs_com/justinw/229829/o_dd."
+ count +
".png"
;
count ++;
if
(count > 15) count = 1;
}
</script> 本文转自Justin博客园博客,原文链接:http://www.cnblogs.com/justinw/archive/2010/03/28/1698684.html,如需转载请自行联系原作者
|