livezilla浮动代码示例

<script type=”text/javascript”>
var lastScrollY=0;
function heartBeat(){
   diffY=document.documentElement.scrollTop;
   percent=0.1*(diffY-lastScrollY);
   if(percent>0)percent=Math.ceil(percent);
   else percent=Math.floor(percent);
   document.getElementById(“sorollDiv1”).style.top=parseInt(document.getElementById
(“sorollDiv1″).style.top)+percent+”px”;
   lastScrollY=lastScrollY+percent;
}
window.setInterval(“heartBeat()”,1);
</script>
<div id=”sorollDiv1″ style=”width:180px; height:50px; right:30px;position:absolute;top:170px; text-
aling:right;”>
<a onclick=”sorollDiv1.style.display =’none'” href=”javascript:;” style=”color:ff0000; “> <img src=”/images/upgrade/close.gif” border=”0″></a><br>
<a href=”javascript:void(window.open
(‘http://www.livezilla.cc/livezillademo/livezilla.php’,”,’width=590,height=550,left=0,top=0,resizable=yes,m
enubar=no,location=no,status=yes,scrollbars=yes’))”><img
src=”http://www.livezilla.cc/livezillademo/image.php?id=05” width=”141″ height=”81″ border=”0″
alt=”开始交流”></a><noscript><div><a href=”http://www.livezilla.cc/livezillademo/livezilla.php
target=”_blank”>开始交流</a></div></noscript>
<br>
LiveZilla在线客服演示
</div>

http://hi.baidu.com/xxiaopp/blog/item/5428aad44266170fa18bb781.html

标签