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

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


<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.οnscrοll=aa;
script>
head>

<body onload="init()">
<div id="apDiv1">div>
<div id="apDiv2">div>
body>
html>

你可能感兴趣的:(广告窗口不随鼠标滚动变化)