Sunday, February 27, 2011

Update: Google WebFont FOUT (Flash of Unstyled Text)

I recently wrote about how I'm dealing with the Google WebFont FOUT (Flash of Unstyled Text). On one occasion I saw a case where the Google script failed to load and I ended up with a blank area on my screen where the heading should have been. So I put in one more small change so that after 10 seconds the h1 will be made visible no matter what else is going on.

Here's the code I added:

var showH1 = function() {
      $("div.article h1").css({'visibility':'visible'});
    }
    setTimeout(showH1,10000);

Post a Comment

Note: Only a member of this blog may post a comment.