简体   繁体   English

jQuery 模态 Window 出现在 IE7 和 IE8 中的元素下

[英]jQuery Modal Window appearing under elements in IE7 and IE8

I have a modal window powered by jquery on a page.我在页面上有一个由 jquery 提供支持的模态 window。 It works perfectly under chrome, firefox and IE8 but IE6 and IE7 the window displays underneath other elements and in an incorrect position.它在 chrome、firefox 和 IE8 下完美运行,但在 IE6 和 IE7 下,window 显示在其他元素下方和不正确的 position 中。

Here is the css for the window:这是 window 的 css:

.simple_overlay {
display: none;
z-index: 10000;
background-color: #FCFCFC;
background-image: none;
background-image: url(http://static.flowplayer.org/img/commerce/box-512.png);
padding: 20px;
width: 675px;
height: 400px;
min-height: 200px;
-moz-border-radius: 8px 8px 8px 8px;
border: 10px solid rgba(82, 82, 82, 0.698);
-moz-box-shadow: 0 0 90px 5px #000;
-webkit-box-shadow: 0 0 90px #000;
}

You might be having some problems with your z-index there.您的 z-index 可能存在一些问题。 Try putting position:relative on that class.尝试将 position:relative 放在 class 上。

Heres a lengthier explanation of the IE z-index gimmics这是对 IE z-index 噱头的更长解释

http://annevankesteren.nl/2005/06/z-index http://annevankesteren.nl/2005/06/z-index

IE 6 and 7 reset the z-index ('locked at that value') stack every time it sees a position value that is not static. IE 6 和 7 每次看到不是 static 的 position 值时都会重置 z-index(“锁定在该值”)堆栈。 This means that if you have something above this element that is position: relative or something else, this element will only be locked at this layer (or 0 if there is not a z-index), and z-index provided will be relative to other elements at this z-index.这意味着如果你在这个元素之上有一些东西是position: relative或其他东西,这个元素将只锁定在这一层(如果没有 z-index,则为 0),并且提供的 z-index 将相对于此 z-index 处的其他元素。 Fix it by making sure it is relative to the entire page, and not some arbitrary parent.通过确保它相对于整个页面而不是某个任意父级来修复它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM