jquery - YouTube 在 IE10 的每个选项卡上嵌入了叠加层

标签 jquery jquery-ui internet-explorer jquery-tools internet-explorer-10

我遇到了一个奇怪的问题,似乎无法找到解决方案。使用 JqueryTools 选项卡小部件或 JqueryUI 选项卡小部件嵌入 Youtube 视频时,它会不断将其覆盖在每个选项卡上。这只发生在IE中,专门用IE10测试过。有人知道为什么吗?

我创建了一个jsfiddle来更好地说明这个问题:http://jsfiddle.net/ncfbX/19/

编辑:

不允许我在不包含一些代码的情况下提交它,所以:

HTML:

<div class="main">
    <div class="slides">Slides division</div>

    <div id="tabs">
        <ul>
            <li><a href="#tabs-1">tab1</a></li>
            <li><a href="#tabs-2">tab2</a></li>
            <li><a href="#tabs-3">tab3</a></li>            
        </ul>
        <div id="tabs-1">
            <div class="inner_panel">
                <p>working</p>
<iframe width="531" height="270" src="http://www.youtube.com/embed/7_nyhwuEX2c?rel=0" frameborder="0" allowfullscreen></iframe>
            </div>
        </div>
        <div id="tabs-2">
             <div class="inner_panel">
                 <p>Tab2 should not have a youtube video embedded.</p>     
            </div>
        </div>
        <div id="tabs-3">
             <div class="inner_panel">
                 <p>Tab3 should not have a youtube video embedded.</p>                 
            </div>
        </div>
    </div>
</div>

CSS:

.inner_panel{height:350px;}

JAVASCRIPT:

$(document).ready(function(){
   $('#tabs').tabs();
});

最佳答案

好吧,我找到了一个修复程序,显然它与 Youtube 不尊重动态分配的 z-index 有关。

在选项卡下嵌入 Youtube 视频时请使用以下代码,以使其在 IE10 下正常工作:

<iframe title="YouTube video player" width="480" height="390" src="[YOUR_YOUTUBE_URL_HERE]?wmode=transparent" frameborder="0" wmode="Opaque">

?wmode=transparent 位于 URL 末尾,wmode="Opaque" 作为额外参数使其发挥作用。

关于jquery - YouTube 在 IE10 的每个选项卡上嵌入了叠加层,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14410162/

相关文章:

jquery - 更改所选选项的 css 元素

jquery - Jquery UI 对话框的问题

jquery - 在动画滚动期间将拖动的 div 传输到其他连接的可排序对象

html - CSS :hover selects the wrong element in IE8

javascript - Font-Awesome 在 IE8 中渲染不一致

html - 为什么 Disabled = ture 对于 html 有效?

jquery - 如何用jQuery制作动态进度条

javascript - 关注页面加载时滚动的元素

jquery - 如何在 CDN 链接之前将 jQuery 与 webpack 一起使用

javascript - jQuery UI 自动完成小部件 : Edit search term before perform search