iframe z 索引下拉菜单
由于我网站的结构,我被迫使用 iframe 来显示下拉菜单 html 文件。如果没有,我将无法在 IE 中看到下拉菜单。这是我正在使用的代码:
<iframe id="a"name="FRAMENAME" src="http://website.com/dropdown.html"
width="1000" style="position:relative" background="#F3F0ED" style="z-index:10000"
height="40" frameborder="0" scrolling="no" allowautotransparency=true></iframe>
现在的问题是下拉菜单隐藏在网站上其他图像的后面。我已经指定了 position:relative 和 z-index:10000
但我无法让它重叠在图像上。这些图像的 z-index 远小于 10000。请问有什么建议吗?
Due to the structure of my website, I am forced to use a iframe to display the dropdown menu html file. if not, I am not able to see the dropdown in IE. Here is the code I am using:
<iframe id="a"name="FRAMENAME" src="http://website.com/dropdown.html"
width="1000" style="position:relative" background="#F3F0ED" style="z-index:10000"
height="40" frameborder="0" scrolling="no" allowautotransparency=true></iframe>
Now the problem is that the dropdown is hiding behind the other images on the website. I have specified position:relative and z-index:10000
but I cannot get it to overlap on the images. The z-index of these images is much less than 10000. Any suggestions please?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您的图像位于 iFrame 之外,当然您的下拉菜单将不会显示,因为您试图告诉下拉菜单离开其窗口。 iframe 是 html 中的一个不同窗口,因此窗口的任何溢出都不会消失,iframe 内的元素不受
z-index
影响。你可以做的是,如果你的
http://website.com/dropdown.html
只有下拉内容,你可以通过jQuery调用它,这将附加你的
下拉内容。将 html
放入div
if your images are outside of your iFrame, of course your dropdown menu will not show up since you are trying to tell the dropdown menu to go out of its windows. iframe is a different window inside your html, therefore any overflow of the window will never go out, elements inside the iframe is not affected with the
z-index
.what you could do is, if your
http://website.com/dropdown.html
has the dropdown content only, you can call it by jQuerythis will append the content of your
dropdown.html
into thediv
只需在“?”后面添加“wmode=透明”即可
不记得了!!也设置属性下拉 z-index。
Just add "wmode=transparent" after "?"
don't remember!! set Property dropdown z-index too.