0

I am using Fancybox2 for my web application and load conent into an iframe. I would like to load iframe faster. I have read the following two SO posts:

fancybox 2 iframe loading issue

Fancybox stuck loading iframe in IE

Here is what I have:

type: 'iframe',
$('.fancybox').fancybox({
            modal: true,  
            width: 900, //I need to set the width of the iframe
            iframe: {
                preload: false 
            } 
});

The load seems faster by using preload: false. However, when the fancybox is shown, its height is always 600 (the default value in Fancybox2). I also tried

height: 'auto' 

and

height: '100%'

The auto option actually generates a window of about 100 pixels tall (which is too short), and the 100% option makes the window use all the available height, (which is too much).

Is Fancybox able to dynamically adjust its height when being configured with the following settings? Through configuration? Or programming?

iframe: {
    preload: false 
}

Here is a jsfiddle link: https://jsfiddle.net/mddc/6e26Lgps/7/

halfer
  • 19,824
  • 17
  • 99
  • 186
curious1
  • 14,155
  • 37
  • 130
  • 231
  • You want iframe to match content height before content is loaded? I wonder if this is possible. – Janis Jul 12 '17 at 18:25
  • If preload is set to false (which is the defualt), Fancybox is able to dynamically math the cotent height or show a scroll bar is the content is too much. – curious1 Jul 12 '17 at 18:27

0 Answers0