Created
September 8, 2017 13:40
-
-
Save surdaft/0628ca88c15487dd9f66eee6e1df0d2b to your computer and use it in GitHub Desktop.
Transition end stuff
This file contains hidden or 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
function whichTransitionEvent() { | |
var t, | |
$e = document.createElement('whatever'), | |
transitions = { | |
'transition': 'transitionend', | |
'OTransition': 'oTransitionEnd', | |
'MozTransition': 'transitionend', | |
'WebkitTransition': 'webkitTransitionEnd' | |
}; | |
for (t in transitions) { | |
if ($e.style[t] !== undefined) { | |
return transitions[t]; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment