Skip to content

Instantly share code, notes, and snippets.

@fredgrott
Created February 13, 2018 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fredgrott/ad397b7be633b4dfacb6446ccace6251 to your computer and use it in GitHub Desktop.
Save fredgrott/ad397b7be633b4dfacb6446ccace6251 to your computer and use it in GitHub Desktop.
prevent premature triggering of css transtions

Pre Load CSS Transitions

html

<body class="preload">

CSS

.preload * {
  -webkit-transition: none !important;
  -moz-transition: none !important;
  -ms-transition: none !important;
  -o-transition: none !important;
}

Javascript

$(window).load(function() {
  $("body").removeClass("preload");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment