网页两侧flash广告代码

来源:互联网 发布:js数字补0 编辑:程序博客网 时间:2024/04/30 04:53

 <!--网页两侧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>

原创粉丝点击