Skip to content

Instantly share code, notes, and snippets.

@AndrewEQ
Forked from johnpolacek/gist:3827270
Last active September 5, 2017 09:29
Show Gist options
  • Save AndrewEQ/a1d06d7d2307539620eb67d417c4c576 to your computer and use it in GitHub Desktop.
Save AndrewEQ/a1d06d7d2307539620eb67d417c4c576 to your computer and use it in GitHub Desktop.
Prevent FOUC
<!-- Prevent FOUC (flash of unstyled content) - http://johnpolacek.com/2012/10/03/help-prevent-fouc/ -->
<style type="text/css"> .no-fouc {display: none;} </style>
<noscript><style type="text/css"> .no-fouc { display: inline; } </style></noscript>
<!-- place in head or end of body -->
<script type="text/javascript">
document.documentElement.className = 'no-fouc';
// add to document ready: $('.no-fouc').removeClass('no-fouc');
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment