悬赏园豆:20
[已解决问题]
解决于 2008-08-15 09:51
<STRONG>:</STRONG><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"<BR>"http://www.w3.org/TR/html4/loose.dtd"><BR><html><BR><head><BR><title>Untitled Document</title><BR><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><BR><link href="images/1.jpg" /><BR></head><BR><script language="javascript"><BR>function showimages(x,y)<BR>{<BR>var images=new Array(27,33)<BR>var time=1<BR>for(var i=0;i<28;i++)<BR>{<BR>for(var j=0;j<34;j++)<BR>{<BR><BR><BR>images[i,j]=""+time+".jpg" <BR>//alert(images[i,j])<BR>time++<BR>}<BR>}<BR>alert(images[27,33]) <BR>alert(time)<BR><BR>var showimage=new Array(7,7)<BR>var z=0;<BR><BR>for(var a=x;a<x+7;a++)<BR>{<BR>var w=0;<BR>for(var b=y;b<y+7;b++)<BR>{ <BR><BR>showimage[z,w]=images[a,b] <BR>alert(images[a,b]) <BR>alert(images[0,0]) <BR>w++ <BR>}<BR>z++ <BR><BR>}<BR>}<BR><BR></script><BR><BR><body><BR><form name="form1" method="post" action=""><BR><input type="button" name="Submit" value="Submit" onClick="showimages(0,0)"><BR></form><BR></body><BR></html><BR><BR><BR>页面执行为何alert(images[0,0]) =921.jpg <BR><BR>,alert(images[a,b]) 第一次为953.jpg <BR>
问题补充:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="images/1.jpg" />
</head>
<script language="javascript">
function showimages(x,y)
{
var images=new Array(27,33)
var time=1
for(var i=0;i<28;i++)
{
for(var j=0;j<34;j++)
{
images[i,j]=""+time+".jpg"
//alert(images[i,j])
time++
}
}
alert(images[27,33])
alert(time)
var showimage=new Array(7,7)
var z=0;
for(var a=x;a<x+7;a++)
{
var w=0;
for(var b=y;b<y+7;b++)
{
showimage[z,w]=images[a,b]
alert(images[a,b])
alert(images[0,0])
w++
}
z++
}
}
</script>
<body>
<form name="form1" method="post" action="">
<input type="button" name="Submit" value="Submit" onClick="showimages(0,0)">
</form>
</body>
</html>
页面执行为何alert(images[0,0]) =921.jpg
,alert(images[a,b]) 第一次为953.jpg