Prevent FOUC in HTML


/ Published in: HTML
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <!-- add after the title tag -->
  2. <style>.js .js-hide{display:none}</style>
  3. <script>document.documentElement.className='js'</script>
  4.  
  5. <!-- add when page has loaded -->
  6. <script>jQuery(function($){$('html').removeClass('js')});</script>

Report this snippet


Comments


You need to login to view comments.