2014-02-20 28 views
0

指定高度下面就以插件的鏈接:如何使用的fancybox 2.1.4

Website

我試過的文檔以及答案在所有選項中SO但沒有爲我工作。

我想問題很簡單。我只需要調整我的fancybox相對於我內部的<div>的高度。

這裏是我的代碼:

$("#home #_prcButtons input[type='button']").each(function() { 
    $('#' + this.id).click(function() { 
     var getId = (this.id === '_proceed') ? 
     $.fancybox({ href: '#questionToEnter', helpers: { overlay: { locked: false, css: { 'background' : 'rgba(58, 42, 45, 0.95)' } } }, openEffect: 'fade', closeEffect: 'fade'}) : window.location.href = "https://google.com"; 
    }); 
}); 

這裏是我的div的CSS:

#questionToEnter { display:none; width:450px; margin:auto; background:#f7d4d4; padding:10px;} 

下面是它的外觀: enter image description here

正如你所看到的,的fancybox韓元不適應我的div的高度。 請幫幫我。 乾杯!

回答

2

解決了我的問題!
我意識到我的<div>高度不到100px。

調整做了minHeight的伎倆:

minHeight: '60'; 

乾杯!

-1

你可以在fancybox中使用「height」屬性來指定它。看到這個例子:

<script type="text/javascript"> 
$(document).ready(function() { 
    $('.fancybox').fancybox({ 
     type: "iframe", 
     padding: 0, 
     fitToView: false, 
     autoSize: false, 
     width: 718, 
     height: 503 
    }); 
}); 
</script> 
+0

這並不適合我。我回答了我自己的問題。這對我來說很有用。感謝您的幫助,雖然。 – witherwind

+0

我真的好奇否定的投票:O –