Skip to content

Instantly share code, notes, and snippets.

@surdaft
Created September 8, 2017 13:40
Show Gist options
  • Save surdaft/0628ca88c15487dd9f66eee6e1df0d2b to your computer and use it in GitHub Desktop.
Save surdaft/0628ca88c15487dd9f66eee6e1df0d2b to your computer and use it in GitHub Desktop.
Transition end stuff
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