我简单的写了一个希望能实现图片轮转的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>
<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>
解决方案 »
- Ajax聊天室,当有消息时,用户输入框内丢失光标,导致用户无法正常输入文字
- 在FF下lo.php取不到值,但IE下就可以
- 问个简单的问题,m_objects_object_ws1_5,想要5,有js 怎么做,在线等!!!
- 请教如何将转义字符\用/替换
- javascript的jsp页面跳转问题
- 关于取颜色值的问题?请大家帮帮我,急,谢了
- 怎么样捕获表单的提交事件?
- 如何判断一个字符串里只有数字和逗号,而且数字之间以","分割?求正则表达式及javascript代码
- JavaScript语法问题:关于function里的this和with
- JS 取值问题
- 求json绑定jquery treeview的函数
- javascript如何做条件判断。简单初级问题。突然转不过来。。。
这样?
ParametersvCode Required. Variant that specifies the function pointer or string that indicates the code to be executed when the specified interval has elapsed.
iMilliSeconds Required. Integer that specifies the number of milliseconds.
sLanguage Optional. String that specifies one of the following values: JScript Language is JScript.
VBScript Language is VBScript.
JavaScript Language is JavaScript.