在 Internet Explorer 中订购 [英] Order in Internet Explorer
问题描述
我为移动网站创建了一个菜单,当您单击菜单按钮时,菜单会滑动打开,这就是页面;
唯一的问题是,在 IE 和 Windows 手机中,菜单不是最顶层的元素,因此会在对象后面滑动.
我尝试更改 z-index、位置类型、hasLayout 无济于事.
我将不胜感激.
J
您似乎正在处理一个已知错误:
在 Internet Explorer 中,定位元素生成新的堆叠上下文,从 z-index 值 0 开始.因此 z-index 无法正常工作."
您可以在 Quirksmode 网站上查看错误报告以及在这篇博文.
本质上你要做的就是将它包装在一个具有更高 Z-index 的元素中,例如以下是解决方法的快速草图:
<div style="position:absolute;z-index:1000;">...
I've created a menu for a mobile site, when you click the menu button the menu slides opend, this is the page;
The only problem is that in IE and Windows phone the menu is not the top-most element so slides behind objects.
I have tried to change the z-index, position type, hasLayout to no avail.
I would appreciate any assistance.
J
It looks like you might be dealing with a known bug:
"In Internet Explorer positioned elements generate a new stacking context, starting with a z-index value of 0. Therefore z-index doesn’t work correctly."
You can see the bug report on Quirksmode website and a workaround explained in this blog post.
Essentially what you have to do is wrap it in an element with higher Z-index, for example Here is a quick sketch of a workaround:
<div style="position: relative; z-index: 3000">
<div style="position:absolute;z-index:1000;">
...
</div>
</div>
这篇关于在 Internet Explorer 中订购的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!