Created
February 19, 2017 03:03
-
-
Save iaminstanceof/6f65957263629e2ee0012e64e2bb35bf to your computer and use it in GitHub Desktop.
JS Animation End Event name chooser
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
// Determine which animationend event is supported | |
function animationEndSelect() { | |
var t; | |
var el = document.createElement('fake'); | |
var transitions = { | |
'transition':'animationend', | |
'OTransition':'oAnimationEnd', | |
'MozTransition':'animationend', | |
'WebkitTransition':'webkitAnimationEnd' | |
} | |
for(t in transitions){ | |
if( el.style[t] !== undefined ){ | |
return transitions[t]; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment