终于 弄明白了
var a = this.getElementsByTagName('ul')[0];
if(a){
var This = a;
clearInterval(This.time);
This.time = setInterval(function(){
This.style.height = This.offsetHeight+18+"px";
if(This.offsetHeight>=120){
clearInterval(This.time);
}
},30)
}
}
//鼠标离开菜单,二级菜单动画收缩起来。
aLi[i].onmouseout=function(){
var b = this.getElementsByTagName('ul')[0];
if(b){
var This = b;
clearInterval(This.time);
This.time = setInterval(function(){
This.style.height = This.offsetHeight-18+"px";
if(This.offsetHeight<=0){
clearInterval(This.time);
}
},30)
}