Javascript Internet explorer 6 Z索引问题

Javascript Internet explorer 6 Z索引问题,javascript,html,css,internet-explorer,browser,Javascript,Html,Css,Internet Explorer,Browser,我有一个弹出DIV(js触发),它显示一个图像。很简单 问题是,这个DIV必须与位于DIV下面的选择重叠 它适用于除IE6之外的所有浏览器 当触发js并显示DIV时,z索引不正确,因为选择下拉列表与DIV部分重叠 这只是在IE6中 有人有线索吗 以下是div的css: .pop_komm { position: absolute; z-index: 20; height: 52px; width: 208px; left: 760px; top: 239px; display:none; zo

我有一个弹出DIV(js触发),它显示一个图像。很简单

问题是,这个DIV必须与位于DIV下面的选择重叠

它适用于除IE6之外的所有浏览器

当触发js并显示DIV时,z索引不正确,因为选择下拉列表与DIV部分重叠

这只是在IE6中

有人有线索吗

以下是div的css:

 .pop_komm {
position: absolute;
z-index: 20;
height: 52px;
width: 208px;
left: 760px;
top: 239px;
display:none;
zoom:1;
 }
我已经尝试过删除缩放,并编辑了一些css上面没有运气

为什么这在IE6中不起作用


谢谢,我也有这个问题。我知道的唯一修复方法是隐藏页面中的所有
选择。然后在弹出窗口关闭时再次显示它们


编辑

我建议您使用jquery,但如果您不想,这里有100%的javascript解决方案(没有jquery)

在中查看我的代码

JS

var d = document;
function showPopup(){
    d.getElementById("popup").style.display = "block";
    updateSelects(d.getElementsByTagName("select"), "none");
}
function hidePopup(){
    d.getElementById("popup").style.display  = "none";
    updateSelects(d.getElementsByTagName("select"),  "inline");
}

function updateSelects(itens, value){
    for (i=0; i < itens.length;  i++) {
        itens[i].style.display = value;    
    }    
}
var d=文档;
函数showPopup(){
d、 getElementById(“弹出”).style.display=“块”;
更新选择(d.getElementsByTagName(“选择”),“无”);
}
函数hidePopup(){
d、 getElementById(“弹出”).style.display=“无”;
更新选择(d.getElementsByTagName(“选择”),“内联”);
}
函数更新选择(ITEN,值){
对于(i=0;i
HTML

<select>
    <option>one</option>
    <option>two</option>    
</select>

<input type="button" onclick="showPopup()" value="show"/>

<div id="popup">
    This is my popup
    <input  type="button" onclick="hidePopup()" value="hide"/>
</div>

一
2
这是我的弹出窗口

如果您不介意将一些jQuery添加到您的项目中,因为有一个jQuery插件专门设计用于规避此问题:。您只需对要修复的元素调用该函数,它就会为您对它们应用
iframe
hack


更多信息

如果我没记错的话,IE6会忽略所选元素的
z-index
,这是一个众所周知的错误,也就是说,它总是在所有其他元素之前,不管它们的
z-index


基本方法是,当需要使用Javascript在上面添加内容时,隐藏有问题的
选择
,或者覆盖一个
iframe
“垫片”来隐藏它。有关更多详细信息,请参见此问题:

选择元素,iframe显示在IE中的所有内容之上。您需要使用iframe来反作用下拉列表


当人们发现我们在过去10年中一直在处理的这个bug时,我们会爱上它。:)