Code to add and remove animations

#43 · closed · 1 comments

View on GitHub ↗

rlaferla

I'd like to see code to add/remove the animation in the README. Please add this: ``` function magicCSS(elementId, animationName, callback) { const node = document.getElementById(elementId); node.classList.add("magictime", animationName); function handleAnimationEnd() { node.classList.remove("magictime", animationName); node.removeEventListener("animationend", handleAnimationEnd); if (typeof callback === "function") callback(); } node.addEventListener("animationend", handleAnimationEnd); } ```

Comments

miniMAC

Thanks, but my library is made with simple CSS animations. The example you saw on the Animate.css library is simply a javascript recommendation from its author.