How do you resize Fancybox at runtime?

后端 未结 18 1892
情深已故
情深已故 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 03:53

    Thanks to everyone who contributes to StackOverflow.com. You all have been life-savers to me many times over. Now, I finally get to contribute something. Below is how I was able to over come the resize fancybox at runtime quandry:

    I assigned the href element specific attributes with dimension PHP vars passed to it. Then called and set the attribute in a click-event, with the fancybox control function and parameters embedded within...

    LINK
    
    $(".asset").click(function(){
    
        var assetW = $(this).attr('assetW');
    
        //to display inter-activities..
        $(".asset").fancybox({
    
        width       : assetW,
        fitToView   : false,
        autoSize    : true,
        closeClick  : false,
        openEffect  : 'none',
        closeEffect : 'none',
           'onComplete' : function(){
             $.fancybox.resize();
    
          }
      });
    });
    

提交回复
热议问题