2015-10-09 63 views
3

使用Featherlight jQuery插件和设置文本作为我的灯箱的内容,我的灯箱的宽度约为屏幕的80%:http://goo.gl/4BVzHM。但是,如果我用YouTube iframe替换文字,则可以将lightbox的宽度缩小到500px左右,然后裁剪视频。Featherlight.js插件:当内容是一个iframe时灯箱的宽度问题

代码:

<a id='open_lightbox' data-featherlight='.lightbox_content' href='#'>open lightbox</a> 
<div class='lightbox_content'> 
    <iframe width="1280" height="720" src="https://www.youtube.com/embed/g7fbe-oV-X0?rel=0" frameborder="0" allowfullscreen></iframe> 
</div> 

我尝试使用过jQuery的装订方法:

$('#open_lightbox').featherlight(
    { 
     iframe: 'https://www.youtube.com/embed/g7fbe-oV-X0?rel=0', 
     iframeWidth: 1200, 
     iframeHeight: 800 
    } 
); 

同样的问题。

(也有上面和下面的视频薄薄的白色横带,我不明白为什么)

回答

0

消除背景白色

添加background: none;featherlight-content DIV

要改变宽度使用'!重要'

style="width: 600px !important;