代码,如下:为什么图片,不会随着拉动而动.而是静止不动的?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<script language="javascript">
var x=10;
var y=-10;
function fly() //以下几行是什么意思的???????
{
pic.style.top=parseInt(pic.style.top) - y;
pic.style.left=parseInt(pic.style.left) - x;
if(parseInt(pic.style.top)<0){y=-y;}
if(parseInt(pic.style.top)>300){y=-y;}
if(parseInt(pic.style.left)<0){x=-x;}
if(parseInt(pic.style.left)>630){x=-x;}
window.setTimeout("fly()",300);
}
</script>
</head>
<body onLoad="fly()">
<div id="pic" style="position:absolute;top:20;left:40">
<img src="3243545.jpg">
</div>
</body>
</html>