导航条菜单的制作6-2编程挑战
代码要怎么写啊
代码要怎么写啊
2016-03-19
window.onload=function(){
var aLi=document.getElementsByTagName('li');
for(var i=0; i<aLi.length; i++){
aLi[i].onmouseover=function(){
//鼠标经过一级菜单,二级菜单动画下拉显示出来
var oSubNav=this.getElementsByTagName('ul')[0];
if(oSubNav){
var this=oSubNav;
clearInterval(This.time);
}
This.time=setInterval(function()){
This.style.height=This.offsetHeight+16+"px";
}
if(This.offsetHeight>=120)
clearInterval(This.time);
},30)
}
}
}
举报