[code="java"]
function invoice(st,ed,len){
this.spd=20;
this.ul=document.getElementById('invoiceing');
this.dv=this.ul.parentNode;
this.st=parseInt(st,10);
this.ed=parseInt(ed,10);
this.len=len;
this.doing.apply(this);
}
invoice.prototype={
show:function(){
this.ul.innerHTML='';
this.ul.previousSibling.innerHTML='入票中......';
this.dv.style.display='block';
this.dv.style.height=document.body.clientHeight;
this.dv.style.width=document.body.clientWidth;
},
stop:function(){
window.clearInterval(this.running);
this.ul.previousSibling.innerHTML='确定';
this.ul.previousSibling.firstChild.onclick=this.hide;
},
hide:function(){
this.dv.style.height='0px';
this.dv.style.width='0px';
this.dv.style.display='none';
},
rupiao:function(){
var o=this;
return function(){
var li=document.createElement('
li.innerHTML=o.lpad();
o.ul.appendChild(li);
if(o.st++>=o.ed)o.stop();
}
},
lpad:function(){
var snum=this.st.toString();
while(snum.length<this.len)snum='0'+snum;
return snum;
},
doing:function(){
this.show();
var fun=this.rupiao();
this.running=window.setInterval(fun,this.spd);
}
}
[/code]
[code="java"]
[/code]
这个函数在运行完毕时要给"确定"那个超链加上invioce.hide事件 ,但是发现此时的this已经不是invoice了 取不到变量dv
求解