How to change size of popup box in jquery fancy box v2.1.4? [closed]

∥☆過路亽.° 提交于 2019-12-10 12:18:37

问题


I am using jquery fancy-box v2.1.4 (see the fancybox website here). Fancybox is working fine, but I am having trouble changing the size of pop up window. How can I control the size of the fancybox popup window?


回答1:


FancyBox as built in method to set width and height to the "window" generated to hold the content... check the website for further instructions, but here's a hit:

// initialize popup iframe (fancybox)
$(".yourframeclass").fancybox({
'autoDimensions': false,
'padding'       : 0,
'width'         : 940,
'height'        : 400,
'autoScale'     : false,
'transitionIn'  : 'none',
'transitionOut' : 'none',
 'type'          : 'iframe'
 });

Here I'm setting a popup with fixed 940px by 400px (it can be % values as well)... and if the content is larger then the fancybox holder, it will generate scroll bars on that same holder and not on the document itself!!!




回答2:


i dont know hopely this is useful.

$("yourSelector").fancybox({
    'width': 560, //change this value with width u want
    'height': 340 //change this value with height u want
});


来源:https://stackoverflow.com/questions/14871722/how-to-change-size-of-popup-box-in-jquery-fancy-box-v2-1-4

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!