out of memory at line 6 ?图片轮转尝试!
我简单的写了一个希望能实现图片轮转的js,但是每次运行的时候都出来out of memory at line 的错误提示,感觉逻辑应该没有问题,请帮看看是哪里没有搞通?谢谢!
<HTML>
<HEAD>
<script type="text/javascript">
function picshow()
{
var r1 = document.getElementById("img1");
var r2 = document.getElementById("img2");
var r3 = document.getElementById("img3");
var r4 = document.getElementById("img4");
var r5 = document.getElementById("imgshow");
rtemp = r5.src;
r5.src = r4.src;
r4.src = r3.src;
r3.src = r2.src;
r2.src = r1.src;
r1.src = rtemp;
setTimeout(picshow(),6000)
}
</script>
</HEAD>
<BODY onLoad="picshow();">
<P>WelCome to My site!<BR>Hope can bring more funny for you!<BR>Enjoying yourself!</P>
<table width="303" border="0" align="center">
<tr>
<td colspan="4"><img id="imgshow" src="img/05.jpg" width="400" height="300" alt=""></td>
</tr>
<tr>
<td width="100"><img id="img1" src="img/01.jpg" width="100" height="75" alt="" style="background-color: #0099FF"></td>
<td width="100"><img id="img2" src="img/02.jpg" width="100" height="75" alt="" style="background-color: #FF0000"></td>
<td width="100"><img id="img3" src="img/03.jpg" width="100" height="75" alt="" style="background-color: #FFFF00"></td>
<td width="100"><img id="img4" src="img/04.jpg" width="100" height="75" alt="" style="background-color: #FF00FF"></td>
</tr>
</table>
<P> </P>
</BODY></HTML>