php168对联广告代码-解决滚动问题
- php168对联广告代码-解决滚动问题
发布时间:2010-05-28 类别:PHP技术 来源:侠客工作室 -
- 1
- 2
- 3
- 4
- 5
- <script language="JaScript" type="text/jascript">
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("web_ad1").style.top=parseInt(document.getElementById
("web_ad1").style.top)+percent+"px";
document.getElementById("web_ad2").style.top=parseInt(document.getElementById
("web_ad1").style.top)+percent+"px";
lastScrollY=lastScrollY+percent;
//alert(lastScrollY);
}
suspendcode12="<DIV id=\"web_ad1\" style=‘left:2px;POSITION:absolute;TOP:120px;‘><a href=# target=_blank><img src=http://cfan.net.cn/tutu/200406301.jpg border=0></a></div>"
suspendcode14="<DIV id=\"web_ad2\" style=‘right:2px;POSITION:absolute;TOP:120px;‘><a href=# target=_blank><img src=http://cfan.net.cn/tutu/200406301.jpg border=0></a></div>"
document.write(suspendcode12);
document.write(suspendcode14);
window.setInterval("heartBeat()",1);
</script>
把上面的代码插入到head.htm文件
- <SCRIPT LANGUAGE="JaScript">
<!--//目的是为了做风格方便
document.write(‘<div class="wrap">‘);
//-->
</SCRIPT>
这段代码的下边.
其中<a href=# target=_blank><img src=http://cfan.net.cn/tutu/200406301.jpg border=0></a>
是修改广告的图片和链接的地方,
欢迎大家使用!不是本人原创的,也是找的,感谢原创的作者
其实原因很简单,就是好多的对联广告代码不符合Web标准,导致广告的图片不随滑块的滚动而滚动- <script language="JaScript" type="text/jascript">
-
中搜索:php168对联广告代码-解决滚动问题 中搜索:php168对联广告代码-解决滚动问题
中搜索:php168对联广告代码-解决滚动问题 中搜索:php168对联广告代码-解决滚动问题
中搜索:php168对联广告代码-解决滚动问题 中搜索:php168对联广告代码-解决滚动问题 - ☆☆☆技术交流群:5684178☆☆☆
- 上一篇:joomla中jdoc:include的介绍
- 下一篇:PHP168调用大分类下栏目相关代码