关于导航条菜单的二级显示与隐藏(js)
这里有3个问题:aLi[i].onmouseover=function(){ if(sub){
var that =sub;
1:if(sub)这句不写行不行?
2:var that =sub;不把sub赋值给它可以吗?直接把sub写在定时器里面如sub.style.height
3:这里获取为啥不用classname啊?如:var sub=this.getElementsByClassName("subNav);
4:aLi[i].onmouseover=function(){直接sub.style.display="block; sub.style.height=sub.offsetheight+16+"px; }