Reputation: 357
Is it possible to avoid having the white screen when a page loads? Particularly for the iframes i'm using on my page? it looks odd having a box of white on the screen while the parent contents are themed already.
Thanks in advance!! :)
Upvotes: 2
Views: 4114
Reputation: 1850
You could make the iframe invisible until it loads.
Making it invisible with the following iframe.style.visibility='hidden';
will make your iframe hidden but it will still occupy the space it used to have
And when it loads simply make it visible again with iframe.style.visibility='visible';
and you won't see any flashing..
Clean and simple imo.
Upvotes: 0
Reputation: 536567
If the iframes are on the same domain, you could use JavaScript to set style.visibility= 'hidden'
on the iframes from the parent document, then have the child documents reach up into the parent document and call a function to set visibility
back to visible
when they're loaded enough to have a stylesheet with the correct background. (onload
on the child frame, or potentially sooner.)
I don't know that it's worth it, really. People are used to incomplete rendering whilst a page loads.
Upvotes: 0
Reputation: 541
Have you tried setting the background color of the iframe to the background color of your parent page?
Upvotes: 2