Skip to content

Instantly share code, notes, and snippets.

@NeilJS
Created May 2, 2012 08:33
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NeilJS/2575101 to your computer and use it in GitHub Desktop.
Save NeilJS/2575101 to your computer and use it in GitHub Desktop.
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