Created
July 7, 2018 11:40
-
-
Save thybzi/f3cfb9c57246ed077d9f33e1ef06e39f to your computer and use it in GitHub Desktop.
Not tested in older browsers
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 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