【问题标题】:YouTube embedded videos wont play in modal window in IE8YouTube 嵌入的视频不会在 IE8 的模态窗口中播放
【发布时间】:2012-09-24 08:42:28
【问题描述】:

在 Firefox、IE7、IE9 和其他浏览器中,YouTube 嵌入工作正常,但在 IE8 中单击视频时没有任何反应。
我认为它可能与 Z-index 相关的 CSS 问题?我试过改变周围的东西,但没有运气。
任何帮助都会很棒。 Visit the page and click the images to see the problem.

这是模式的 CSS:

.youtubemodal {
width: 590px;
height: 464px;
position:fixed;
z-index:700;
top:180px;
left:50%;
display:none;
background-image: url('images/youtubeconsole.png');
margin-left:-295px;
}

.youtubediv {
position:absolute;
left:15px;
top:15px;
}

.youtubexbutton {
bottom: 12px;
right:13px;
position:absolute;
width:26px;
height:26px;
background-image:url('images/youtubex.png');
}

和脚本:

jQuery('#youtube').click(function(){
jQuery('.youtubemodal').show();
});

和 HTML:

<div class="youtubemodal"><div class="youtubediv"><iframe width="560" height="400"     src="http://www.youtube.com/embed/G5FRxH8ytJk" frameborder="0" allowfullscreen></iframe></div>

【问题讨论】:

    标签: javascript jquery html css youtube


    【解决方案1】:

    &lt;head&gt; 标签之后使用这个

    <meta content='IE=EmulateIE7' http-equiv='X-UA-Compatible'/>
    

    【讨论】:

    • 很遗憾没用,我也试过用 IE8 替换 IE7,不过还是谢谢
    • 仍然没有什么遗憾,我知道嵌入式视频一般工作没问题,只是当它在自己的 div 中弹出时它似乎不起作用
    • 可能是你没有关闭'
      '的问题?
    • 嗨,Anton,我解决了它并在下面给出了答案,最后有点傻,但非常感谢您的帮助。
    【解决方案2】:

    解决了:我的youtubediv 没有宽度或高度,所以我将其更改为覆盖 YouTube 视频的大小。

    【讨论】:

    • 不要忘记接受您的答案,以供其他人参考。
    猜你喜欢
    相关资源
    最近更新 更多
    热门标签