YouTube embedded overlays on each tab for IE10

百般思念 提交于 2020-01-05 03:05:09

问题


I am running into a weird issue and can't seem to find a solution. Using either JqueryTools tabs widget or JqueryUI tabs widget when a Youtube video is embedded it keeps overlaying it on every tab. This only occurs in IE, specifically tested with IE10. Anyone know why?

I created a jsfiddle to better illustrate this issue: http://jsfiddle.net/ncfbX/19/

Edit:

Wouldn't let me submit it without including some code, so:

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();
});

回答1:


Alright I found a fix, apparently it had something to do with Youtube not respecting the dynamically assigned z-index.

Use the following code when embedding a Youtube video under tabs inorder to get it to work correctly with IE10:

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

?wmode=transparent at the end of the URL and wmode="Opaque" as an extra parameter is what makes it work.



来源:https://stackoverflow.com/questions/14410162/youtube-embedded-overlays-on-each-tab-for-ie10

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!