【发布时间】:2013-02-08 01:54:36
【问题描述】:
我有 <div> 元素来显示弹出消息。我已经设置了z-index:1000 并添加了<iframe>,但是 div 元素仍然没有显示在 Safari 浏览器中的实时流视频(嵌入插件)上方。我使用了 Chrome 和 Firefox,两者都可以,但在 Safari Windows 中无法使用。
This 是我在小提琴中的代码。
<BODY style="background:transparent">
<div style="position:relative; z-index:0;">
<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" width="240" height="180">
<param name="wmode" value="transparent"></param>
<embed height="180" width="240" align="left" src="xxxx.avi" autoplay="false" controller="true" wmode="transparent"></embed>
</object>
<object>
<param name="wmode" value="transparent"></param>
<param name="movie" value="http://www.youtube.com/v/Q5im0Ssyyus?fs=1&hl=en_US"></param>
<param name="allowFullScreen" value="true"></param>
<param name="allowscriptaccess" value="always"></param>
<embed src="http://www.youtube.com/v/Q5im0Ssyyus?fs=1&hl=en_US" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="240" height="180"></embed>
</object>
</div>
<div id="draggable">
<div class="drag">
<p>Drag me around!! Drag me around!!</p>
<p>Drag me around!! Drag me around!!</p>
<p>Drag me around!! Drag me around!!</p>
</div>
<iframe class="frame"></iframe>
</div>
谁能发现这段代码有任何问题?
【问题讨论】:
-
在这种情况下你真的应该远离内联样式。当您为所有
<div>s 放置一个 CSS 类时,它会让事情变得更加简洁。另外,您在哪个版本的 Safari 中进行测试?它在 Safari 6.0 中对我来说似乎很完美(<div>在上面,等等)。 -
我在 Safari 5 (Win XP) 中得到了一些非常奇特的结果。我得到了你正在谈论的问题,但我也得到了一个没有加载的 QuickTime 块。此外,整个 jsFiddle 页面似乎都怪异地定位东西。我忍不住只是想你会对不同版本的结果感兴趣。祝你好运队友:)
-
我在 win 7 中使用了 safari 5.1.7。我的意思是在所有嵌入对象之上制作可拖动的 div 元素。谢谢。
-
我已经更新了代码并放了一个 CSS。我试过这些代码在 Chrome 和 Firefox 中运行良好,但在 Safari(OS Wind 7)中运行良好。有什么建议吗?
标签: html safari z-index always-on-top html-object