为了账号安全,请及时绑定邮箱和手机立即绑定

我的代码为啥不行。设置了class属性

我的代码为啥不行。设置了class属性

我要坚持11 2017-04-27 10:26:46
var aLi=document.getElementsByClassName('li'); for(var i=0; i<aLi.length; i++){ aLi[i].onmouseover=function(){   var This=this.getElementsByTagName('ul')[0];   clearInterval(This.time)           This.time=setInterval(function(){                This.style.height=This.offsetHeight+8+"px";                if(This.offsetHeight>=120){                    clearInterval(This.time);                }           },30)            //鼠标经过一级菜单,二级菜单动画下拉显示出来 }        //鼠标离开菜单,二级菜单动画收缩起来。 aLi[i].onmouseout=function(){  var This=this.getElementsByTagName('ul')[0];  claerInterval(This.time);  Thi.time=setInterval(function(){                This.style.height=This.offsetHeight-8+"px";                if(This.offsetHeight<=0){                    clearInterval(This.time);                }           },30) } }}
查看完整描述

1 回答

已采纳
?
__innocence

TA贡献313条经验 获得超208个赞

//鼠标离开菜单,二级菜单动画收缩起来     这句话往下三行,claerInterval  这个单词写错了

查看完整回答
反对 回复 2017-04-27
  • 1 回答
  • 0 关注
  • 1044 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信