飘浮广告显示脚本类(VBS,JS双版)[4]

[入库:2005年8月18日] [更新:2007年3月24日]

本文简介:选择自 applebbs 的 blog

    if(objdiv==null)return;
    objdiv.style.pixelleft = ileft + document.body.scrollleft;
    objdiv.style.pixeltop = itop + document.body.scrolltop;
    if(irnd>98){leftflag=!leftflag;}
    irnd=math.round(math.random()*100);
    if(irnd>99){topflag=!topflag;}
    if(leftflag){
       ileft=ileft+leftstep*math.random();
    }else{
       ileft=ileft-leftstep*math.random();
    }
    if(topflag){
       itop=itop+topstep*math.random();
    }else{
       itop=itop-topstep*math.random();
    }
    if(ileft<0){
       ileft=0;
    leftflag=true;
     }
    else if(ileft>width-offwidth){
       ileft=width-offwidth;
    leftflag=false;
    }
    if(itop<0){
       itop=0;
    topflag=true;
     }
    else if(itop>height-offheight){
       itop=height-offheight;
    topflag=false;
    }
 }
 file://定时移动广告的图片
 function starttimer(){
    if(objname=="")return;
    file://alert(objname+".floatscroll();");
    file://inter=setinterval(objname+".floatscroll()",delay);
 }
 file://显示图片的html代码
 function showimagehtml(adimgsrc,adhref,adtitle){
   var swidth,sheight;
   if(imagewidth<5){
     swidth="";
   }else{
     swidth=" width='"+imagewidth+"'";
   }
   if(imageheight<5){
     sheight="";
   }else{
     sheight=" height='"+imageheight+"'";
   }
   document.write("<div id='img"+divid+"' style='position:absolute;'>");
   document.write("<a href='"+adhref+"' target='_blank' title='"+adtitle+"'>");
   document.write("<img src='"+adimgsrc+"' border='0'"+swidth+sheight+">");
   document.write("</a></div>");
 }
 file://显示flash文件的html代码
 function showflashhtml(adimgsrc,adhref,adtitle){
   var swidth,sheight;
   if(imagewidth<5){
     swidth=" width='80'";
   }else{
     swidth=" width='"+imagewidth+"'";
   }
   if(imageheight<5){
     sheight=" height='80'";
   }else{
     sheight=" height='"+imageheight+"'";
   }
   document.write("<div id='img"+divid+"' style='position:absolute;'>");

本文关键:飘浮广告显示脚本类(VBS,JS双版)
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top