UpDownRoller.prototype.uid=100;
 function UpDownRoller(objID,selfName){
   var obj=document.getElementById(objID);
   obj.style.position="relative";
   obj.style.zIndex=this.uid++;
   this.target=obj;
   this.autoRoll=false;
   this.selfName=selfName;
   this.timerID=null;
 }
 UpDownRoller.prototype.setAutoRoll=function(b){
   if(this.autoRoll==b){
      return null;
   }
   this.autoRoll=b;
   if(b){
     if(this.timerID){
        window.clearInterval(this.timerID);
     }
     this.timerID=window.setInterval(this.selfName+".roll()",10);
   }else{
     this.target.style.pixelTop=0;
   }
 }
 UpDownRoller.prototype.roll=function(){
   if(!this.autoRoll){
       return false;
   }
   var t=this.target;
   t.style.pixelTop=document.body.scrollTop;
 }
 if(document.getElementById("floater")){
   var ft=new UpDownRoller("floater","ft");
   ft.setAutoRoll(true);
 }
评论
发表评论

提醒: 该博客已发表在公共论坛,博客所有留言会成为论坛回贴,留言请注意遵守论坛发贴规则

您还没有登录,请登录后发表评论

yangzhichao
搜索本博客
最近加入圈子
最新评论