先把高度变高(变a:hover中的高度),增加了多少的高度就减去多少的高度(看ul的高度和刚刚a:hover中的高度相差多少(称为差值),就margin-top:-(差值);)。
for(var j=0;j<this.children.length; j++) {
if(this.children[j].tagName == "UL") {
this.children[j].style.overflow = "visible";
}
}
写成这样控制台就不会就报错了。
if(this.children[j].tagName == "UL") {
this.children[j].style.overflow = "visible";
}
}
写成这样控制台就不会就报错了。