admin管理员组文章数量:1421432
I have a div with fixed size and position relative on my page. (I unfortunately am not allowed to share this code so bear with me if you can). I wanted to to have a disabled input bee re-enabled when double clicked but as you may know disabled inputs don't like to fire click events. I came up with a solution which involves putting an input
absolutely positioned inside of the relatively positioned container along with an absolutely positioned div
with the same dimensions and position. When double clicking I change the div's display to none
. This works beautifully in other browsers but IE 10 (I haven't checked lower versions) doesn't respect the z-indexes
that I have placed on the div and input. The div has a z-index
of 2 and the input has a z-index
of 1 but IE ignores this and allows me to click "through" the div and into the input as if the div weren't there. I'm not asking for anyone to debug my code as I can't show it but I would appreciate any known workarounds for this if it's a mon problem/bug.
I have a div with fixed size and position relative on my page. (I unfortunately am not allowed to share this code so bear with me if you can). I wanted to to have a disabled input bee re-enabled when double clicked but as you may know disabled inputs don't like to fire click events. I came up with a solution which involves putting an input
absolutely positioned inside of the relatively positioned container along with an absolutely positioned div
with the same dimensions and position. When double clicking I change the div's display to none
. This works beautifully in other browsers but IE 10 (I haven't checked lower versions) doesn't respect the z-indexes
that I have placed on the div and input. The div has a z-index
of 2 and the input has a z-index
of 1 but IE ignores this and allows me to click "through" the div and into the input as if the div weren't there. I'm not asking for anyone to debug my code as I can't show it but I would appreciate any known workarounds for this if it's a mon problem/bug.
2 Answers
Reset to default 6Internet-Explorer is very tricky particularly with z-index and positions.
Okay, whats the Solution?
Hard work. Be sure that elements are mostly have an position. Must in some places work with position: relative;
.
To address the problem with the z-index, you must go from the highest parent (<html>
) up to all childs and set each child a z-index (started with 0
), increase each z-index, example:
html {
z-index: 0;
}
body {
z-index: 1;
}
header {
z-index: 2;
}
header nav {
z-index: 3;
}
Generally, check the validity: HTML Validator, CSS Validator
Add this:
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
And make sure your doctype is set
<!doctype html>
本文标签: javascriptIE 10 not respecting zindexStack Overflow
版权声明:本文标题:javascript - IE 10 not respecting z-index - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745353599a2654921.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论