Skip to content

Instantly share code, notes, and snippets.

@noahub
Last active April 4, 2017 19:03
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 noahub/d9f2513d128d9ccb7e76 to your computer and use it in GitHub Desktop.
Save noahub/d9f2513d128d9ccb7e76 to your computer and use it in GitHub Desktop.
Animate a page element on load.
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.5.1/animate.min.css">
<script>
//The page element that will be animated on page load.
var yourElement = "#lp-pom-image-54";
//The effect that will be applied to your page element. See https://daneden.github.io/animate.css/ for full list.
var yourEffect = "slideInUp";
var effectClass = "animated " + yourEffect;
$( document ).ready(function() {
$(yourElement).show().addClass(effectClass).one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function(){
$(this).removeClass();
});
});
/**
* Do not remove this section; it allows our team to troubleshoot and track feature adoption.
* TS:0002-03-028
*/
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment