

#menu2 ul li:hover ul li ul{ display:none;}
#menu2 ul li:hover ul li ul{ display:none;} #menu2 ul li.current ul{
display:block;}
加了这个样式,还有下面这段JS
startList = function() {
if (document.all&&document.getElementById) {
navRoot = document.getElementById("menu2");
var allli = navRoot.getElementsByTagName("li")
for (i=0; i node = allli[i];
node.onmouseover=function() {
this.className+=" current";
}
node.onmouseout=function() {
this.className=this.className.replace(" current", "");
}
}
}
}
window.onload=startList;
//-->
script>
这个ie6不支持那句话了,它只支持a的伪类!这个是不是要改JS了啊?
这个肯定是JS代码的问题了,有一句说得很对,IE6不支持伪类,所以你后加的那句隐藏三级列表的也失效了,应该在JS里面给它加上不显示!
因为在鼠标移动到二级菜单的时候三级菜单没有隐藏
只要在就可以了
注意把前面的ID 修改为你自己的id
#menu2 ul li.current ul{
display:block;}
加了这个样式,还有下面这段JS
startList = function() {
if (document.all&&document.getElementById) {
navRoot = document.getElementById("menu2");
var allli = navRoot.getElementsByTagName("li")
for (i=0; i node = allli[i];
node.onmouseover=function() {
this.className+=" current";
}
node.onmouseout=function() {
this.className=this.className.replace(" current", "");
}
}
}
}
window.onload=startList;
//-->
script>
ie6 是不支持div的伪类 :hover的 你把你的 li里加个a标签 然后css 控制a标签就好了
#menu2 ul li.current ul{
display:block;}
加了这个样式,还有下面这段JS
startList = function() {
if (document.all&&document.getElementById) {
navRoot = document.getElementById("menu2");
var allli = navRoot.getElementsByTagName("li")
for (i=0; i node = allli[i];
node.onmouseover=function() {
this.className+=" current";
}
node.onmouseout=function() {
this.className=this.className.replace(" current", "");
}
}
}
}
window.onload=startList;
//-->
script>
ie6 是不支持div的伪类 :hover的 你把你的 li里加个a标签 然后css 控制a标签就好了
不知道加在哪里啊,试了几次,都没有调试成功,能麻烦你帮我改改么?
