I'm facing one of the craziest problems I've ever found in css...
I have two CSS-jQuery horizontal dropdowns, one up and one below, displaying the drop-list when clicking on it.
The problem comes when I click the upper dropdown in IE6 and IE7, and absolute positioned element goes over relative positioned ones. Upper dropdown list (absolute) shows behing the dropdown (relative) below.
JavaScript:
$("button").click(function(e){
$(".menu").hide();
$(this).siblings(".menu").show();
e.stopPropagation()
});
$(document).click(function(){$(".menu").hide()});
HTML:
<div class="top">
<div class="dropdown">
<button>Dropdown1 v</button>
<div class="menu">
<a href="#link">Option a</a>
<a href="#link">Option b</a>
<a href="#link">Option c</a>
</div>
</div>
<div class="dropdown">
<button>Dropdown2 v</button>
<div class="menu">
<a href="#link">Option d</a>
<a href="#link">Option e</a>
<a href="#link">Option f</a>
</div>
</div>
</div>
CSS:
.dropdown{float:left;display:inline;clear:left;position:relative}
.menu{position:absolute;left:0;top:22px;z-index:1}
.menu a{display:block}
.menu{display:none;border:1px solid #ccc;padding:3px;background:#ffffe0}
Here's the example:
http://jsfiddle.net/AEBaW/
SOLUTION HERE:
http://jsfiddle.net/AEBaW/2/