为什么我的onscroll只执行一次
自制浮动广告
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style type="text/css">
<!--
#threenine {
position:absolute;
width:140px;
height:300px;
z-index:1;
}
#threenine1 {
position:absolute;
width:140px;
height:300px;
z-index:2;
}
-->
</style>
<script language="javascript" type="text/javascript">
<!--
var advInitTop=300;//层距离顶端的初始值
function move()
{ window.document.getElementById("threenine1").style.top=advInitTop+window.document.body.scrollTop;
window.document.getElementById("threenine").style.top=advInitTop+window.document.body.scrollTop;
}
window.onscroll=move;//窗口的滚动事件,当页面滚动时调用move()函数 //-->
</script>
</head>
<body>
<table width="910" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="140" valign="top"><div id="threenine1">
<div align="center"><img src="images/ad1.gif" width="80" height="300" />
</div>
</div></td>
<td height="600" bgcolor="#0099CC"><p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p></td>
<td width="140" align="left" valign="top"><div id="threenine">
<div align="center"><img src="images/ad2.gif" width="80" height="300" /></div>
</div></td>
</tr>
</table>
</body>
</html>
结果只执行一次onscroll,然后再滚也不发生移动了??