aLi[i].onmouseover=function(){
//鼠标经过一级菜单,二级菜单动画下拉显示出来
this.getElementsByTagName('ul')[0].style.overflow="visible";
}
//鼠标离开菜单,二级菜单动画收缩起来。
aLi[i].onmouseout=function(){
this.getElementsByTagName('ul')[0].style.overflow="hidden";
}
主要将overflow设置成visible就可以显示了。
//鼠标经过一级菜单,二级菜单动画下拉显示出来
this.getElementsByTagName('ul')[0].style.overflow="visible";
}
//鼠标离开菜单,二级菜单动画收缩起来。
aLi[i].onmouseout=function(){
this.getElementsByTagName('ul')[0].style.overflow="hidden";
}
主要将overflow设置成visible就可以显示了。
已采纳回答 / 慕的地6863477
可能是因为a标签是行内元素 不能直接用 .on这样来选择 必须要用 .nav li a.on 才生效 所以你试试用 li a.on 这样也会生效。可能是这样。
2016-11-19
已采纳回答 / 慕仔7290954
就是block和inline-block都是块状元素,只不过block它占一整行,inline-block只占一块。多敲代码多试一试自然也就理解。
2016-11-19