Skip to content

Instantly share code, notes, and snippets.

@O-Zone
Last active November 23, 2023 22:43
Show Gist options
  • Save O-Zone/7230245 to your computer and use it in GitHub Desktop.
Save O-Zone/7230245 to your computer and use it in GitHub Desktop.
Get the name of the browsers transitionEnd event. After calling this, window.transitionEnd will contain the browser specific name of the transitionEnd event. This is an extract of EvandroLG's transitionEnd snippet, without all support for testing different elements and using cache.
(function (window) {
var transitions = {
'transition': 'transitionend',
'WebkitTransition': 'webkitTransitionEnd',
'MozTransition': 'transitionend',
'OTransition': 'otransitionend'
},
elem = document.createElement('div');
for(var t in transitions){
if(typeof elem.style[t] !== 'undefined'){
window.transitionEnd = transitions[t];
break;
}
}
})(window);
@O-Zone
Copy link
Author

O-Zone commented Apr 30, 2014

Thank you @ossreleasefeed - hereby updated! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment