0

我试图编写一个弹出窗口,但在 IE6 和 IE7 中出于某种原因在灰色叠加层上使用 z-index 时遇到了一些问题。

有没有办法在 IE6/IE7 中使用 jQuery 修复 z-index 错误,或者有其他方法吗?

请检查 jsfiddler http://jsfiddle.net/NrxbC/5/

任何帮助深表感谢。

最好的问候约翰

4

3 回答 3

1

IE7你可以解决在fadeIn之前暂时删除属性filter,然后稍后重新应用

$(el).css("filter", "").fadeIn(200, function () {
    $(el).css("display","inline-block;").css("filter", "alpha(opacity=65)");
});

http://jsfiddle.net/NrxbC/11/

于 2012-05-07T12:34:02.417 回答
1

为什么不使用诸如 colorbox、fancybox 或 lightbox 之类的开源软件……
(我暂时无法发表评论)

于 2012-05-07T12:56:55.477 回答
0

在父 div 中为 z-index 设置更高的值...例如,

<div id="parent" style="z-index:2002">
<div id="child" style="z-index:2000">// The actual div which needs the z-index
</div>
</div>

另请参阅此页面

它可能看起来很傻......但它确实有效......

于 2012-05-07T12:32:27.830 回答