网页浮标

本文介绍了一段用于实现网页上浮动广告栏效果的JavaScript脚本。该脚本通过监测滚动条位置来调整两个广告栏的位置,确保它们始终处于可视范围内。一个广告链接指向客户端首卖页面,另一个则导向新手指导页面。
<SCRIPT language=JavaScript>
lastScrollY=0;
function heartBeat(){
diffY=document.body.scrollTop;
percent=.1*(diffY-lastScrollY);
if(percent>0)percent=Math.ceil(percent);
else percent=Math.floor(percent);
document.all.lovexin12.style.pixelTop+=percent;
document.all.lovexin14.style.pixelTop+=percent;
lastScrollY=lastScrollY+percent;
}
suspendcode12="<DIV id=lovexin12 style='left:10px;POSITION:absolute;TOP:10px;'><A HREF='http://gw.the9.com/events/clients/index.html' target=_blank Title='客户端首卖<img src='images/client.jpg' border=0 width='90' height='220'></A></div>"
document.write(suspendcode12);
suspendcode14="<DIV id=lovexin14 style='right:10px;POSITION:absolute;TOP:10px;'><A HREF='http://gw.the9.com/zt/xszd/index.html' target=_blank Title='新手指导'><img src='images/90x220.jpg' border=0 width='90' height='220'></A></div>"
document.write(suspendcode14);
window.setInterval("heartBeat()",1);
</SCRIPT> 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值