So I'm using mediabox which creates lightbox Iframes. I've modded it quite a bit, and there's just ONE last thing I want to accomplish. When the "popup" occurs, my site is still loading in the iframe; the process looks unproffesional. I have 2 key pieces of code, and I was wondering how I could manage having the app wait a little bit before showing the iframe site, so it has a headstart on loading?
This states the duration of the effect, but the page waits until it is finished to start loading.
resizeOpening: true, // Determines if box opens small and grows (true) or starts at larger size (false)
resizeDuration: 200, // Duration of each of the box resize animations (in milliseconds)
resizeTransition: false, // Mootools transition effect (false leaves it at the default)
This here basically sets up the iframe. I'm wondering if I can put the preload before everything else and I'd get the result I'm after. Please let me know.
else {
mediaType = 'url';
mediaWidth = mediaWidth || "638px";
mediaHeight = mediaHeight || "1000px";
mediaId = "mediaId_"+new Date().getTime(); // Safari may not update iframe content with a static id.
preload = new Element('iframe', {
'src': URL,
'id': mediaId,
width: mediaWidth,
height: mediaHeight,
scrolling : 'no',
'frameborder': 0
});
startEffect();
}
This loads the iframe in the lightbox.
else if (mediaType == "url") {
image.setStyles({backgroundImage: "none", display: ""});
preload.inject(image);
}
Any help with this dilemna is appreciated, but I understand that it's not simple.