How do you resize Fancybox at runtime?

后端 未结 18 1891
情深已故
情深已故 2020-11-30 03:22

Does anyone know how to resize the jQuery Fancybox during runtime?

When initializing the fancybox I can do this:

$(\"tag\").fancybox({ \'frameWidth\         


        
18条回答
  •  佛祖请我去吃肉
    2020-11-30 04:05

    I just want to make you be aware of it.

    After searching for solutions using javascript to adjust height me and my partner realized something stunning.

    Check whether the containing elements of #fancybox-inner has PADDING or MARGIN set.

    This is the key element (direct children of #fancybox-inner margin/padding definition.

    The children elements (#fancyfox-inner > div > .here) can have padding, but dont forget to adjust:

     $('#element').fancybox({
        'onComplete' : function(){
            $.fancybox.resize();
        }
    }); 
    

提交回复
热议问题