致癌药物:请大家帮我看看这个java script有什么问题??

来源:百度文库 编辑:神马品牌网 时间:2024/04/27 21:51:31
请大家帮我看看问什么不执行settimeout函数!!谢谢

<html>
<head>
<title>C</title>
<script language="javascript">

function autogo(){
if (x<=1000){
x=x+50
c1.style.left=x
setTimeout("autogo()",5)
}
}

</script>
</head>
<body>
<div ID="c1" STYLE="position:absolute;left:100;top:100;width:100;height:100;">
<img src="f:\2210.gif">
</div>

<a href="javascript:autogo()">autogo</a>
</body>
</html>

setTimeout("autogo()",5)
不能调用自己,调用自己的话就是一个死循环,所以页面永远都关闭不了

同意楼上。
说的就是这个道理