Your code will keep the iframe hidden if javascript is disabled. This one will only hide/show the frame if javascript is enabled.
//iframe flashes white bugfix with jquery
//set visibility to ‘hidden’ in the actual page
$(“iframe”).load(function() {
$(this).css(“visibility”, “visible”);
});
$(“iframe”).ready(function() {
$(this).css(“visibility”, “hidden”);
});
It does work, however it works only once. After the iFrame-constructed page loads, if you click on a link that it’s supposed to load another page on said iFrame, and because said iFrame is already loaded and hence visible, the white Flash is back.
wont let me post full html:
id=”fancybox-frame” name=”fancybox-frame’+(new Date).getTime()+'” frameborder=”0″ hspace=”0″ allowtransparency=”true” style=”visibility:hidden;” onload=”this.style.visibility = \’visible\’;” scrolling=”‘+e.scrolling+'” src=”‘+d.href+'”
You need to do 3 things really:
make iframe invisible, in css “visible:hidden”
make iframe allow transparency, allowtransparency=”true”
make the body it displays have a transparent background, “background-color:transparent”
Thank you so much! This works very well! It’s ridiculous how Internet Explorer 9 STILL shows a white background for iframes during page load! Unbelievable.
Thanks for the code
i was just going through comment where someone suggested jquery alternative saying that javascript needs to be enable for you solution
i would like to know how are you going to use jquery is javascript is disabled
also does anyone has any solution to load iframe inside flash ?
i am looking for something to save my page from stealing
because the hiding is also done with jquery. that means if there is no javascript, it is never hidden and never shown its just “there” with a white flash. however, coding for people without javascript is no longer a valid thing, everyone has javascript enabled but the most paranoid people, and those people are not people u want viewing your site unless u run some kind of conspiracy site LOL. yknow?
wow, cool
Exactly what I needed! Didn’t know this was possible.
Thankee Jesus!!!!
thank YOU!!!!
Why doesn’t it work for me? I have 3 pages with iframes: archive, current and black white series
When I look in IE 7 or 8 the white box still flashes… ???
Your code will keep the iframe hidden if javascript is disabled. This one will only hide/show the frame if javascript is enabled.
//iframe flashes white bugfix with jquery
//set visibility to ‘hidden’ in the actual page
$(“iframe”).load(function() {
$(this).css(“visibility”, “visible”);
});
$(“iframe”).ready(function() {
$(this).css(“visibility”, “hidden”);
});
Hi,
Is there any chance you could tell me how/where would I integrate this in Facybox?
Many thanks
works fine !! thx a lot – greetings from austria – jodeldijodeldiö
Any W3C valid solution?
Love you. Thats just simple genius
It does work, however it works only once. After the iFrame-constructed page loads, if you click on a link that it’s supposed to load another page on said iFrame, and because said iFrame is already loaded and hence visible, the white Flash is back.
struggles with this problem in fancybox for ages,
go to the fancy box jacked.js
look for first occurance of “<iframe"
change to:
wont let me post full html:
id=”fancybox-frame” name=”fancybox-frame’+(new Date).getTime()+'” frameborder=”0″ hspace=”0″ allowtransparency=”true” style=”visibility:hidden;” onload=”this.style.visibility = \’visible\’;” scrolling=”‘+e.scrolling+'” src=”‘+d.href+'”
You need to do 3 things really:
make iframe invisible, in css “visible:hidden”
make iframe allow transparency, allowtransparency=”true”
make the body it displays have a transparent background, “background-color:transparent”
Thank you so much! This works very well! It’s ridiculous how Internet Explorer 9 STILL shows a white background for iframes during page load! Unbelievable.
Here I find another good solution that is working:
http://swsharinginfo.blogspot.com/2011/11/avoid-iframe-white-flash-issue-while.html
thx. so easy…
Thanks a million. I wasted hours trying to figure this out. A simple solution that works.
Thanks!!! I spend almost 2 hours trying to figure out by myself but this helps so much!! thanks
Thanks!!! You helped me a lot.
Awesome! Thanks a ton!
Thank you! This was very helpful.
Thanks for the code
i was just going through comment where someone suggested jquery alternative saying that javascript needs to be enable for you solution
i would like to know how are you going to use jquery is javascript is disabled
also does anyone has any solution to load iframe inside flash ?
i am looking for something to save my page from stealing
because the hiding is also done with jquery. that means if there is no javascript, it is never hidden and never shown its just “there” with a white flash. however, coding for people without javascript is no longer a valid thing, everyone has javascript enabled but the most paranoid people, and those people are not people u want viewing your site unless u run some kind of conspiracy site LOL. yknow?
Thank you!
Perfect. Thank you!
YOU ARE MY HERO!!!!! Thanks a lot, i was searching tooo Long to get rid of this problem! ;-)
Is there any way to load iframe on a higher priority even before loading the css .. ?
hello sir , have u find the solution ???
I need this the also for my site i want to hide some divs from that iframe then show the content of iframe
My code is
function RemoveExtraDiv(){
Perfect! Short, Simple.. Just Great!
Thanks so much for sharing this!
Someone with JS disabled (for privacy or security reasons) will not see the iframe content
You are a genious !!
Thanks =)