PDA

View Full Version : Frog.js - Getting a flash of the thumbs as page loads



vkbarefoot
02-24-2008, 06:07 AM
1) Script Title: Frog.js - http://www.dynamicdrive.com/dynamicindex4/frogjs/index.htm

2) Script URL (on DD): http://www.vikibarefoot.com/Chris/FROG/Silent_Protest.html

3) Describe problem: I am getting a flash of the thumbs as the page loads. Looks terrible. What to do?

Thank you ..... viki

jscheuer1
02-24-2008, 05:00 PM
The script is supposed to do that, or at least that's how it works in many browsers. You can stop it from doing that by adding this in the head of your page:


<script type="text/javascript">
document.write('<style type="text/css">#FrogJS a img {display:none;}<\/style>');
</script>

vkbarefoot
02-24-2008, 05:59 PM
Thank you .... I'll try it .... v

vkbarefoot
02-25-2008, 09:46 PM
That was the ticket ... thank you

bonmarie
09-17-2008, 05:21 PM
Thank you so much for this solution...the thumbnails were driving me crazy!

Nachturnal
09-25-2008, 07:39 PM
This results in code that doesn't validate as both Transitional or Strict XHTML.

Is this something I can do from an external style sheet? Or from within Frog.js itself? IE, as you know, is super picky when it comes to clean code.

EDIT: But it does stop the FOUC! Thank you for posting this fix. It should have been included in the script by default. It's an unavoidable occurrence, even if the images are very small in file size.

jscheuer1
09-26-2008, 12:05 AM
This results in code that doesn't validate as both Transitional or Strict XHTML.

Is this something I can do from an external style sheet? Or from within Frog.js itself? IE, as you know, is super picky when it comes to clean code.

EDIT: But it does stop the FOUC! Thank you for posting this fix. It should have been included in the script by default. It's an unavoidable occurrence, even if the images are very small in file size.

Yes, you can put the actual code:


document.write('<style type="text/css">#FrogJS a img {display:none;}<\/style>');

At the top of the frog.js file.

By way of explanation:


XHTML should not be used for a number of reasons, unless you are serving it as application/xml. And if you do, IE will not render it.

If you are stuck with XHTML for whatever reason, there is nothing intrinsically invalid about the code, just having an on page script is all it takes to set off the validator for XHTML DOCTYPEs.

If you are accustomed to using on page scripts with XHTML, you know how to comment them to make them valid. But in some cases this will not work. In any case, the preferred method is to make the code/script external.