Advertisement
Guest User

Untitled

a guest
May 24th, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. window.animateCSS = function(element, animationName, callback) {
  2. element.classList.add('animated', animationName)
  3. function handleAnimationEnd() {
  4. element.classList.remove('animated', animationName)
  5. element.removeEventListener('animationend', handleAnimationEnd)
  6. if (typeof callback === 'function') callback()
  7. }
  8. element.addEventListener('animationend', handleAnimationEnd)
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement