首页/js外包代码/js对联广告代码

js对联广告代码

发布-xiaoming | 浏览量-

1.代码直接复制放到head中就可以。

复制内容到剪贴板
  1. <script language="JavaScript" type="text/javascript">   
  2. lastScrollY=0;   
  3. function heartBeat(){    
  4. var diffY;   
  5. if (document.documentElement && document.documentElement.scrollTop)   
  6. diffY = document.documentElement.scrollTop;   
  7. else if (document.body)   
  8. diffY = document.body.scrollTop   
  9. else  
  10. {/*Netscape stuff*/}   
  11. percent=.1*(diffY-lastScrollY);    
  12. if(percent>0)percent=Math.ceil(percent);    
  13. else percent=Math.floor(percent);    
  14. document.getElementById("lovexin12").style.top=parseInt(document.getElementById   
  15. ("lovexin12").style.top)+percent+"px";   
  16. document.getElementById("lovexin14").style.top=parseInt(document.getElementById   
  17. ("lovexin12").style.top)+percent+"px";   
  18. lastScrollY=lastScrollY+percent;    
  19. }   
  20. suspendcode12="<DIV id=\"lovexin12\"style='left:2px;POSITION:absolute;TOP:120px;'>35ui<img src='http://www.35ui.cn/themes/Sean_Red/style/seanloo/logo.gif'></div>"  
  21. suspendcode14="<DIV id=\"lovexin14\" style='right:2px;POSITION:absolute;TOP:120px;'>35ui<img src='http://www.35ui.cn/themes/Sean_Red/style/seanloo/logo.gif'></div>"  
  22. document.write(suspendcode12);    
  23. document.write(suspendcode14);    
  24. window.setInterval("heartBeat()",1);   
  25. </script>   

 

原文地址:http://www.35ui.cn/post/20110705821.html

标签javascript培训班js网页制作网页制作做网页常用代码做网页

上一条: Javascript培训班_Javascript常用函数
下一条: 字号、pt、px、em换算对照表

或许你还对下面的文章感兴趣