您的位置:首页 > 其它

广告窗口不随鼠标滚动变化

2015-08-18 11:17 239 查看
广告窗口不随鼠标滚动变化

<!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=utf-8" />
<title>无标题文档</title>
<style type="text/css">
<!--
#apDiv1 {
position:absolute;
left:251px;
top:51px;
width:529px;
height:210px;
z-index:2;
background-color: #0000FF;
}
#apDiv2 {
position:absolute;
left:128px;
top:381px;
width:912px;
height:18663px;
z-index:-1;
background-color: #FF0000;
}
-->
</style>
<script>
var xx=0;
function init(){
xx =document.getElementById("apDiv1").offsetTop;
}
function aa(){
document.getElementById("apDiv1").style.top=xx+document.documentElement.scrollTop+"px";
}
window.onscroll=aa;
</script>
</head>

<body onload="init()">
<div id="apDiv1"></div>
<div id="apDiv2"></div>
</body>
</html>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  窗口滚动 广告