Created
May 5, 2018 05:22
-
-
Save asktami/2ae8957f0b199e018fae96550960cd3d to your computer and use it in GitHub Desktop.
Javascript to fix FOUC (Flash of Unstyled Content) - goes in html document HEAD
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <head> | |
| ... | |
| <!-- to fix FOUC (Flash of Unstyled Content) --> | |
| <script type="text/javascript"> | |
| var elm=document.documentElement; | |
| elm.style.display="none"; | |
| document.addEventListener("DOMContentLoaded",function(event) { elm.style.display="block"; }); | |
| </script> | |
| </head> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment