复主代码 代码如下: <br>lastScrollY=0;<br>function heartBeat(){ <br>var diffY;<br>if (document.documentElement && document.documentElement.scrollTop)<br>diffY = document.documentElement. scrollTop;<br>else if (document.body)<br>diffY = document.body.scrollTop<br>else<br>{/*Netscape 항목*/} <p>//alert(diffY);<br>퍼센트=.1*(diffY-lastScrollY); <br>if(퍼센트>0)퍼센트=Math.ceil(퍼센트); <br>다른 퍼센트=Math.floor(퍼센트); <br>document.getElementById("ad_left").style.top=parseInt(document.getElementById</p> <p>("ad_left").style.top) 퍼센트 "px";<br>document.getElementById("ad_right").style.top=parseInt(document.getElementById</p> <p>("ad_left").style.top) 퍼센트 "px";</p> <p>lastScrollY=lastScrollY 퍼센트; <br>//alert(lastScrollY);<br>}<br>function hidead(num)<br>{<br>showad = false;<br>if(num==1)<br>document.getElementById( "ad_left").style.display="none";<br>else if(num==2)<br>document.getElementById("ad_right").style.display="none";<br>}<br>var ClosebuttonHtml1 = '<div style="위치: 절대;bottom:0px;right:25px;margin:2px;padding:2px;z-index:2000;"><a href="javascript:void( 0);" onclick="hidead(1)" style="color:#ffffff;text-꾸밈:none;font-size:12px;">关闭</a></div>';<br>var ClosebuttonHtml2 = '<div style="위치: 절대;bottom:0px;right:25px;margin:2px;padding:2px;z-index:2000;"><a href="javascript:void(1);" onclick="hidead(2)" style="color:#ffffff;text-꾸밈:none;font-size:12px;">关闭</a></div>';<br>ad1=" <div id=/"ad_left/" style='right:10px;POSITION:absolute;TOP:160px;'></div>"<br>ad2="<DIV id=/"ad_right/" style='right:10px;POSITION:absolute;TOP:160px;'><br><a href='tencent://message/?uin=758541860&Menu=yes'><img height='120 ' src='../images/qq.gif' border='0' width='110'></a></div>";<br>document.write(ad1); <br>document.write(ad2); <br>window.setInterval("heartBeat()",1);<br>