window.onload=function(){
var aA=document.getElementsByTagName("a");
for(var i=0;i<aA.length;i++){
aA[i].onmouseover=function(){
clearInterval(this.time);
var This=this;
This.time=setInterval(function(){
This.style.width=This.offsetWidth+8+"px";
if(This.offsetWidth>=120){
clearInterval(This.time);
}
},30)
}
aA[i].onmouseout=function(){
clearInterval(this.time);
var This=this;
This.time=setInterval(function(){
This.style.width=This.offsetWidth-8+"px";
if(This.offsetWidth<=100){
This.style.width="100px";
clearInterval(This.time);
}
},30)
}
}
}
这段代码中,this.time是什么意思? 还有为啥要定义This?
zhangcl
PHPBird
李晓健