Chandan Sarkar
Chandan Sarkar

Reputation: 31

How do i avoid a flash of unstyled content (FOUC) on Google Sites

I have placed some custom HTML, CSS, and jQuery inside an HTML box in my google site. but as the page loads, the unformatted content shows for several seconds until the loading is complete. attempts to add the following:

html { visibility: hidden; }

and then turning it back on later in jQuery do not appear to work inside a Google site.

Does anyone have another suggestion?

Upvotes: 2

Views: 512

Answers (1)

Dave H.
Dave H.

Reputation: 1

I don't know if this works on a google site or not, but using <body style='display:none;'> and then in the jQuery document ready function place $("body").show(); has worked for me.

For some reason using style on the body statement works faster than the CSS file even if the CSS file appears in the head section.

Upvotes: 0

Related Questions