你要是想显示层图片就直接ad1和ad2去掉放上<img
src="显示图片地址">
<html><head>
<meta http-equiv="Content-Type" content="text/html charset=gb2312" />
<style type="text/css">
#ad1,#ad2{
-webkit-transition: all .5s ease-out
-moz-transition: all .5s ease-out
-o-transition: all .5s ease-out
transition: all .5s ease-out
POSITION:absolute
TOP:120px
width:100px
height:200px
border:1px solid red
}
</style>
</head>
<body>
<div id="mm" style="height:2000pxbackground:#f5f5f5width:500px">
</div>
<DIV id="ad1" style='left:2px'>ad1</div>
<DIV id="ad2" style='right:2px'>ad2</div>
<script language="JavaScript" type="text/javascript">
document.onscroll=function(){
document.getElementById("ad1").style.top=document.body.scrollTop+120+'px'
document.getElementById("ad2").style.top=document.body.scrollTop+120+'px'
}
</script>
</body>
</html>