我最近遇到一个bug,jquery ui对话框内的视频播放器无法点击。最终我通过将position:relative;覆盖为position:inherit;来解决了这个问题。
其他解决方案包括完全删除position:relative;或者使播放器类的z-index不是1。
据我所读,这两种方法都表明在此情况下更改堆叠上下文可以解决我的问题。然而,我仍然不太理解我的情况或堆叠上下文的整体情况。是否有人有任何好的例子/建议可以说明可能发生了什么?
<div class="player">
<div id="videoPlayer_wrapper" style=" position: relative; width:580px; height: 192px;">
<object type="application/x-shockwave-flash" data="/flash/player.swf" width="100%" height="100%" bgcolor="#000000" id="videoPlayer" name="videoPlayer" tabindex="0">
</object>
</div>
</div>
播放器的CSS存放位置
.player {
margin-bottom: 20px;
position: relative;
z-index: 1;
}