Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- window.animateCSS = function(element, animationName, callback) {
- element.classList.add('animated', animationName)
- function handleAnimationEnd() {
- element.classList.remove('animated', animationName)
- element.removeEventListener('animationend', handleAnimationEnd)
- if (typeof callback === 'function') callback()
- }
- element.addEventListener('animationend', handleAnimationEnd)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement