簡體   English   中英

Fancybox寬度不適用

[英]Fancybox width not applying

使用以下JS,寬度未被調整。 使用'750''750px'時無法調整

$('a#city-prompt').fancybox({
    'width': 750
});

我已經在fancybox論壇上發布了這個並沒有得到回應

您可能必須將autoSize設置為false

$('a#city-prompt').fancybox({
    'width': 750,
    'autoSize': false
});

關於文檔的 width

內容類型“iframe”和“swf”的寬度。 如果'autoDimensions'設置為'false',也會為內聯內容設置

這里沒有任何答案對我有用,但是這樣做了:

$.fancybox({
    'content':$("#element").html(),
    'width':'500',
    'autoDimensions':false,
    'type':'iframe',
    'autoSize':false
});

'autoSize':false是丟失的密鑰

試試這個。 您需要將autoSize設置為false

$(".fancybox").fancybox({'width':400,
                         'height':300,
                         'autoSize' : false});

在Fancybox版本2及更高版本中使用'autoSize':false

Fancybox文檔

確保在寫出寬度(以像素為單位)時不包括'。 而不是

'width':'100',你應該'寬度':100,

希望有幫助......

除了其他答案,為了解決高度問題我改變了第998

來自:
to.height = currentOpts.height + double_padding;

至:
to.height = parseInt(currentOpts.height) + parseInt(double_padding);

來自改變_get_zoom_to (第690行)

to.width = currentOpts.width + double_padding;

to.width = parseInt(currentOpts.width) + parseInt(double_padding);

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM