2015-10-09 65 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;