目前,我正在将 Youtube 视频与以下 HAML 代码嵌入到基于 Twitter Bootstrap 的网站中:
.row
.span12
%iframe.span11{ :height => "720", :frameborder => "0", :allowfullscreen => nil, :src => v.video_url }
不幸的是,由于静态高度的原因,在调整浏览器大小或在移动设备上时,这并不能很好地响应。
为 Youtube 实现此嵌入式 iframe 的更好(更动态和响应更快)的方法是什么?
试试这个“响应式视频 CSS”,它非常适合我:https://gist.github.com/2302238 https://gist.github.com/2302238
<section class="row">
<div class="span6">
<div class="flex-video widescreen"><iframe src="https://www.youtube-nocookie.com/embed/..." frameborder="0" allowfullscreen=""></iframe></div>
</div>
<div class="span6">
...
</div>
</section>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)