下一条: 字号、pt、px、em换算对照表 >
js对联广告代码
发布-xiaoming | 浏览量-
1.代码直接复制放到head中就可以。
复制内容到剪贴板
- <script language="JavaScript" type="text/javascript">
- 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*/}
- percent=.1*(diffY-lastScrollY);
- if(percent>0)percent=Math.ceil(percent);
- else percent=Math.floor(percent);
- document.getElementById("lovexin12").style.top=parseInt(document.getElementById
- ("lovexin12").style.top)+percent+"px";
- document.getElementById("lovexin14").style.top=parseInt(document.getElementById
- ("lovexin12").style.top)+percent+"px";
- lastScrollY=lastScrollY+percent;
- }
- 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>"
- 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>"
- document.write(suspendcode12);
- document.write(suspendcode14);
- window.setInterval("heartBeat()",1);
- </script>
原文地址:http://www.35ui.cn/post/20110705821.html 标签:javascript培训班js网页制作网页制作做网页常用代码做网页
或许你还对下面的文章感兴趣