No replies
Last seen: 16 years 2 weeks ago
Joined: 2005-02-20
Posts: 1
Points: 0

Not to be confused with the IE-only FOUC issue, I just like the acronym.

A common idiom that I see a lot has a JS script run at onload to apply some behavioral effect. The problem is that if rendering is slow for any reason, you get a flash of what the content looks like before the script runs. This can be visually disruptive, depending on the behavior in question.

The easy fix is to set display:none in the base stylesheet for those elements that would need to be set to this value by the onload script; that way they never appear in the first place. For example, non-active tabs in a tabbed dialog. However, this technique breaks the page for noscript browsers. (You can't very well change the display value with script if you don't have it).

From a theory point of view, the problem is that the onload event fires after the content has actually been rendered. In fat-client environments you have the ability to intervene after the pack but before showing the dialog (to use the Swing term).

Have others experienced this? Are there workarounds? Or do I have it wrong and something else is causing this problem? (Experienced programmer but still learning CSS/JS). Thanks!