<table id="otbl" background="http://t10.baidu.com/it/u=1456582849,3736110720&fm=0&gp=18.jpg" height="100" width="10%">
<tr>
<td> </td>
</tr>
</table>
<input type="button" value="开始" onclick="Start()">
<script language="JavaScript">
<!--
function Start(){
var otbl = document.getElementById("otbl");
var iWidth = parseInt(otbl.width.split("%")[0]);
if(iWidth < 100){
iWidth = (iWidth + 5) + "%";
otbl.width = iWidth;
}else{
clearInterval(timer);
}
var timer = setTimeout("Start()",1000);
}
//-->
</script>
var inter = setInterval(function(){
w += 2;//每次增加宽度
document.getElementById("table1").style.width = w +"%";
if(w>=100) clearInterval(inter);
},10);//定时器0.01s
// 首先得到页面上所有的table.
var tables = document.getElementsByName("otbl");
var numbers = number.split(",");
// 进行遍历.
for (i = 0; i < tables.length; i++ ) {
var iWidth = parseInt(tables[i].width.split("%")[0]);
if (iWidth < parseInt(numbers[i])) {
iWidth = (iWidth + 1) + "%";
tables[i].width = iWidth;
} else {
clearInterval(timer);
}
}
var timer = setTimeout("test("+number+")",10);
}
谁能看看这段,为什么第二次时number值会发生改变.?
var number = "";
function test(){