.nav li a{display:block; height:30px;text-align:center; line-height:30px; width:120px; margin-left:1px;}
.nav li a.on, .nav li a:hover{ border-radius:10px 10px 0px 0px; background-color:#F60;color:#fff;}
.nav li a.on, .nav li a:hover{ border-radius:10px 10px 0px 0px; background-color:#F60;color:#fff;}
for(var i=0; i<aLi.length; i++){
aLi[i].onmouseover=function(){
var subNav = this.getElementsByClassName('subNav')[0];
subNav.style.overflow = 'visible'; }
aLi[i].onmouseout=function(){
var subNav = this.getElementsByClassName('subNav')[0];
subNav.style.overflow = 'hidden'; }
aLi[i].onmouseover=function(){
var subNav = this.getElementsByClassName('subNav')[0];
subNav.style.overflow = 'visible'; }
aLi[i].onmouseout=function(){
var subNav = this.getElementsByClassName('subNav')[0];
subNav.style.overflow = 'hidden'; }
2.鼠标离开菜单,二级菜单动画收缩起来。
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)
}
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)
}
鼠标经过一级菜单,二级菜单动画下拉显示出来
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)
}
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)
}
我是不是哪里搞错了!!!html+css基础不是说了块级元素用text-align:center会失效,是不能用的吗?<a>标签都已经display:block块级化了,怎么还能用text-align:center呢???????????
2016-08-14