浏览 225 次
|
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
|
|
|---|---|
| 作者 | 正文 |
|
时间:2008-03-28
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);
}
声明:JavaEye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
|
|
| 返回顶楼 | |


