Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Not tested in older browsers
function getTransitionendEventName() {
if ('ontransitionend' in window) {
// Firefox 16+, IE 10+, Chrome 26+, Opera 12.1+, Safari 6.1+
return 'transitionend';
} else if ('onwebkittransitionend' in window) {
// Chrome 4+, Safari 3.1+
return 'webkitTransitionEnd';
} else if ('onmoztransitionend' in window) {
// Firefox 4+
return 'mozTransitionEnd';
} else if ('onotransitionend' in document.body || (navigator.appName === 'Opera')) {
// Opera 10.5+
return 'oTransitionEnd';
} else {
// Not implemented
return null;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.