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/