I am using Fancybox 2.0. I open the content in an iframe. How can I dynamically resize a popup when content in an iframe changes?
I google for hours, but all the links are for either the older version (1.3) or for dead ends.
Thanks for entering!
I used the option before showing to resize it:
beforeShow: function(){ this.width = $('.fancybox-iframe').contents().find('html').width(); this.height = $('.fancybox-iframe').contents().find('html').height(); }
To run this function from within the frame, you need to run the parent element. $. fancybox.update () from the child page, which should resize it.
iframe , autoSize. autoSize true, autoHeight autoWidth true. , "inline", "ajax" "html" .
$.fancybox.open({ padding : 0, href:'http://www.gamespot.com', type: 'iframe', autoSize: true });
That should do it.
$.fancybox({ width:600, height:300, autoResize:false });