求教育 这里的取消冒泡应该怎么写 这样写出来的不管用哇
window.onload=function(){ var aLi=document.getElementsByTagName('li'); for(var i=0; i<aLi.length; i++){ aLi[i].onmouseover=function(event){ var event = event || window.event if(event.stopPropagation){ event.stopPropagation();} else{event.cancelBubble = true;}; var aNav = this.getElementsByTagName('ul'); var animate = setInterval(function(){ aNav[0].style.height = aNav[0].offsetHeight + 5 + "px"; if(aNav[0].offsetHeight >= 120){ clearInterval(animate); } },10); } aLi[i].onmouseout=function(){ var aNav = this.getElementsByTagName("ul")[0]; aNav.style.height = 0; } } } </script>
求教育。这样并不管用哇