hello,
The following dropdown menu works fine in modern browsers (IE7/firefox) but not in IE6. Can someone suggest a fix?
CSS:
#menu {
height: 29px;
background: url(img/menu.png) repeat-x top;
border-left: 1px solid #0b2f3e;
border-right: 1px solid #0b2f3e;
position: relative;
}
#menu ul {
display: none;
position: absolute;
top: 29px;
left: 0;
background: #316f86;
width: 220px;
z-index: 10;
}
#menu ul ul {
top: -1px;
left: 220px;
width: 200px;
border: 1px solid #4a7a8c;
border-bottom: none;
}
#menu li {
float: left;
display: block;
position: relative;
}
#menu li li {
float: none;
}
#menu li a {
float: left;
display: block;
color: #fff;
height: 16px;
line-height: 16px;
padding: 7px 20px 6px 20px;
border-right: 1px solid #0b2f3e;
}
#menu ul li a {
float: none;
border-right: none;
border-bottom: 1px solid #4a7a8c;
}
#menu li a:hover {
border-bottom: none;
}
#menu ul li a:hover {
color: #c0e8ff;
border-bottom: 1px solid #4a7a8c;
}
.menu-bottom {
background: url(img/menu.png) repeat-x bottom;
}
.menu-top {
background: url(img/menu.png) repeat-x top;
}
#menu li:hover ul ul, #menu li:hover ul ul ul, #menu li:hover ul ul ul ul{
display:none;
}
#menu li:hover ul, #menu li li:hover ul, #menu li li li:hover ul, #menu li li li li:hover ul{
display:block;
}
#menu img {
vertical-align: middle;
overflow: hidden;
width: 16px;
height: 16px;
margin: 0 8px 0 0;
}
jQuery: (should be no problem with jquery)
// dropdown menu (unlimited sub-levels)
jQuery("#menu ul").css({display: "none"}); // Opera Fix
jQuery("#menu li").hover(function(){
if (jQuery(this).parent().attr("id") == 'menu') {
jQuery(this).removeClass('menu-top');
jQuery(this).addClass('menu-bottom');
}
jQuery(this).find('ul:first').css({visibility: "visible",display: "none"}).fadeIn(500);
},function(){
if (jQuery(this).parent().attr("id") == 'menu') {
jQuery(this).removeClass('menu-bottom');
jQuery(this).addClass('menu-top');
}
jQuery(this).find('ul:first').css({visibility: "hidden"});
});
I am sure its something with how IE6 treats floats/blocks..but just can't get the hang of it.