【问题标题】:Youtube embed issue with Twitter BootstrapTwitter Bootstrap 的 Youtube 嵌入问题
【发布时间】:2013-04-09 09:14:23
【问题描述】:

我正在流行的 BootStrap 框架上构建一个小型静态网站。不幸的是,我无法提供链接,但基本上我已经构建了一个模态框,单击按钮就会出现其中嵌入的 YouTube 视频。

它工作正常,但如果您关闭模态框,它会消失,但 YouTube 视频会悬停在其他所有内容上,无法摆脱它。这是在 IE10 上。

有没有其他人尝试将视频嵌入到 BootStrap 模块中并有解决方案?

提前致谢,

杰克

编辑

好的,这是一段sn-p代码:

<a id="mediaVideo" class="btn btn-primary btn-large" href="#" data-toggle="modal" data-target="#video">Watch the interview</a>

<!-- Modal -->
<div id="video" class="modal hide fade" style="color: #2a2a2a; width: 590px;" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="myModalLabel">This is the modal title</h3>
</div>
<div class="modal-body">
<p>Small paragraph to describe the video</p>
<iframe width="560" height="315" src="http://www.youtube.com/embed/H542nLTTbu0" frameborder="0" allowfullscreen></iframe>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true">Close Window</button>
<div class="btn-group">
<a class="btn btn-primary dropdown-toggle" data-toggle="dropdown" href="#">
Share This Video
<span class="caret"></span>
</a>
<ul class="dropdown-menu" align="left">
<li><a href="http://www.facebook.com/sharer.php?u=http://www.google.com">Facebook</a></li>
<li><a href="http://twitter.com/share?text=This%20is%20the%20text&url=http://www.google.com">Twitter</a></li>
<li><a href="https://plus.google.com/share?url=http://www.google.co.uk">Google+</a></li>
</ul>
</div>
</div>
</div>
<!--END MODAL-->

【问题讨论】:

  • 代码。你必须发布它。
  • 好吧,等一下,我会放一个sn-p

标签: html twitter-bootstrap youtube


【解决方案1】:

对我来说似乎工作正常:jsFiddle。我正在使用&lt;iframe&gt; 选项,这是在Google Developers 咨询 YouTube 嵌入 API 页面时推荐的选项。

【讨论】:

  • 是 IE10 出了问题,抱歉我忘了说 :) 我已经有一段时间没有发布任何东西了
  • @JackWillDavis 我刚刚在 IE10 上测试了 Fiddle,它似乎工作正常。你还有问题吗?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2013-09-02
  • 2010-11-10
  • 2022-10-13
  • 2012-08-23
  • 2016-11-24
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多