Last active
August 29, 2015 14:07
-
-
Save benadamstyles/1155f662c4a1ad93f718 to your computer and use it in GitHub Desktop.
Helper function to remove element from DOM after a CSS transition has completed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.namespace.killer=function(el,classNameString) { | |
function die() { | |
el.removeEventListener("webkitTransitionEnd",die); | |
el.parentNode.removeChild(el); | |
} | |
el.addEventListener("webkitTransitionEnd",die); | |
el.classList.toggle(classNameString); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment