復(fù)制的提示的代碼,怎么沒(méi)效果,復(fù)制別人的就可以,自己跟著寫(xiě)又不行了。校對(duì)過(guò)了,沒(méi)發(fā)現(xiàn)不一樣。求大神
window.onload=function(){
? ? var aA=document.getElementsByTagName('ul')[0];
? ? for(var i=0; i<aA.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)
? ? ? ? ? ? ?}
? ? ? ? ? }
? ? ? ? ? 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<=0)
? ? ? ? ? ? ? ? ? ? clearInterval(This.time);
? ? ? ? ? ? ? ? },30)
? ? ? ? ? ? ?}
? ? ? ? ? }
? ? ? }
? }
2016-10-29
最后的兩個(gè)花括號(hào)去掉試一下