Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save adamrosloniec/6bb75b4313453d8d3232cbd0301fa675 to your computer and use it in GitHub Desktop.
Save adamrosloniec/6bb75b4313453d8d3232cbd0301fa675 to your computer and use it in GitHub Desktop.
Easiest way to add fade in effect after Page Load
// Add in head section - for fastest loading, before scripts and styles.
<style type="text/css">body{overflow:hidden;pointer-events:none;opacity:0;transition:opacity 2s;-webkit-transition:opacity 2s;}</style>
<script type="text/javascript">window.onload=function(){document.body.setAttribute("style","overflow:initial;opacity:1;pointer-events:initial;");}</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment