Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Cross-browser CSS3 transitionend event for event listeners
// CROSS-BROWSER TRANSITION END EVENT LISTENERS
var transEndEventNames = {
'WebkitTransition' : 'webkitTransitionEnd',
'MozTransition' : 'transitionend',
'OTransition' : 'oTransitionEnd',
'msTransition' : 'MSTransitionEnd',
'transition' : 'transitionend'
},
transEndEventName = transEndEventNames[ Modernizr.prefixed('transition') ]; // bind event listener to transEndEventName eg: this.addEventListener(transEndEventName, callbackFunction, false);
//alert(transEndEventName);
Source: http://modernizr.com/docs/ ... Modernizr.prefixed()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment