Hallo!
Ich habe ein Problem mit der CSS-Angabe "z-index" bei Combo-Boxen im IE.
Im folgenden Beispiel liegt ein Textfeld vor/über einer Combobox. Netscape und Mozilla machen es richtig, beim InternetExplorer will die Combobox einfach nicht in den Hintergrund gehen. Mache ich da etwas falsch, oder ist das ein MSIE-Bug? laut Selfhtml versteht der IE die Angabe und auch das Selfhtml-Besipiel klappt, nur eben nicht unten das mit der Combobox.
Wer weiß Rat?!
<html><head><title>Test</title>
<script type="text/javascript">
<!--
var edit, bp, combo;
function Init() {
edit = eval(document.getElementById("edit"));
combo = eval(document.getElementById("combo"));
edit.style.position = "absolute";
edit.style.top = combo.style.top;
edit.style.left = combo.style.left;
edit.style.zIndex = combo.style.zIndex + 1;
}
function comboChanged() {
document.testform.edit.value = document.testform.combo.options[document.testform.combo.selectedIndex].text;
}
//-->
</script>
</head>
<body onLoad="Init()">
<form name="testform">
<div id="edit">
<input type="text" name="edit" style="width:200px;z-index:2">
</div>
<div id="combo">
<select name="combo" size="1" style="width:218px;z-index:1" onChange="comboChanged()">
<option style="width:218px;z-index:1">eins</option>
<option style="width:218px;z-index:1">zwei</option>
<option style="width:218px;z-index:1">drei</option>
</select>
</div>
</form>
</body>
</html>