﻿//注：如果要让浮动广告在网页左栏显示，只需将上边代码中蓝色标示的right更改为left即可。


　　lastScrollY=0;
　　function heartBeat(){ 
　　　　var diffY;
　　　　if (document.documentElement && document.documentElement.scrollTop)
　　　　　　diffY = document.documentElement.scrollTop;
　　　　else if (document.body)
　　　　　　diffY = document.body.scrollTop
　　　　else
　　　　　　{/*Netscape stuff*/}

　　　　//alert(diffY);
　　　　percent=.1*(diffY-lastScrollY); 
　　　　if(percent>0) percent=Math.ceil(percent); 
　　　　else percent=Math.floor(percent); 
　　　　document.getElementById("lovexin").style.top=parseInt(document.getElementById("lovexin").style.top)+percent+"px";

　　　　lastScrollY=lastScrollY+percent; 
　　　　//alert(lastScrollY);
　　}
　　suspendcode="<DIV id=\"lovexin\" style='right:2px;POSITION:absolute;TOP:140px;z-index:100'>";


 //'这里是右栏浮动广告代码'; 
　　var recontent='<table cellspacing="0" cellpadding="0" class=""><TR><TD vAlign="center" align="middle" background="/alptpl/img/menu_bg.gif" bgColor="#5c9acf" height="26"><SPAN class="STYLE3">软件用户计数器</SPAN></TD></TR><TR class="TableData"><TD align="middle" background="/alptpl/img/table_bg.gif" bgColor="#eceeec" ><span class="style_user">6629</span> </TD></TR><TR class="TableData"><TD align="middle" background="/alptpl/img/menu_bg1.gif" bgColor="#e6f1fb" height="25"><A href="/html/about/customers.html" target="_blank">用户名单</A>　<A href="/html/case" target="_blank">成功案例</A></TD>  </TR></table>';  

　　document.write(suspendcode); 
　　document.write(recontent); 
　　document.write("</div>"); 
　　window.setInterval("heartBeat()",1);


