网页两侧flash广告代码

本文提供了一段用于在网页两侧显示Flash广告的代码示例,并详细解释了如何使用JavaScript控制广告的显示与隐藏,以及如何随着页面滚动进行位置调整。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 <!--网页两侧flash广告代码-->
<div id="couplet_left" style="position: absolute;visibility:hidden;z-index:1">
<embed src='FLASH的URL' quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer"
type="application/x-shockwave-flash" width="80" height="240" wmode="opaque"></embed><table cellspacing="0" cellpadding="0" width="80"
style='font-size:10px;color:#000000'><tr style="background-color:White;"><td  style="width:0px;"></td><td style="CURSOR:hand; width:30px;" onclick="closeflash()">关闭</td>
</tr></table>
</div>
<div id="couplet_right" style="position: absolute;visibility:hidden;z-index:1">
<embed src='FLASH的URL' quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer"
type="application/x-shockwave-flash" width="80" height="240" wmode="opaque"></embed><table cellspacing="0" cellpadding="0" width="80"
style='font-size:10px;color:#000000'><tr style="background-color:White;"><td style="width:50px;"></td><td style="CURSOR:hand; width:20px;" onclick="closeflash()">关闭</td>
</tr></table></div>
       
<script type="text/javascript">
couplet_left.style.visibility='hidden';
couplet_right.style.visibility='hidden';
</script>

<script type="text/javascript">
var MSIE=navigator.userAgent.indexOf("MSIE");
var OPER=navigator.userAgent.indexOf("Opera");

function doCouplet(){
 if((document.body.offsetWidth>800) && MSIE!=-1 && OPER==-1){ 
 couplet_left.style.visibility='visible';
 couplet_right.style.visibility='visible';  
   couplet_left.style.top=100;
   couplet_left.style.left=5;
   couplet_right.style.top=100;
   couplet_right.style.right=5;
 }
}


function closeflash()
{
 couplet_left.style.visibility='hidden';
 couplet_right.style.visibility='hidden';
}

try{
        aryADSeq.push("doCouplet()");
}catch(e){
        doCouplet();
}      

lastScrollX=0;
function heartBeat0()
{
 diffY=document.documentElement.scrollTop;
 percent=.1*(diffY-lastScrollX);
 if(percent>0)
  percent=Math.ceil(percent);
 else
  percent=Math.floor(percent);
 document.all.couplet_left.style.pixelTop+=percent;
 lastScrollX=lastScrollX+percent;
}

window.setInterval("heartBeat0()",1);

lastScrollY=0;
function heartBeat1()
{
 diffY=document.documentElement.scrollTop;
 percent=.1*(diffY-lastScrollY);
 if(percent>0)
  percent=Math.ceil(percent);
 else percent=Math.floor(percent);
  document.all.couplet_right.style.pixelTop+=percent;
 lastScrollY=lastScrollY+percent;
}
window.setInterval("heartBeat1()",1);
</script>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值