Skip to content

Instantly share code, notes, and snippets.

@secretrobotron
Created August 28, 2012 17:30
Show Gist options
  • Save secretrobotron/3501165 to your computer and use it in GitHub Desktop.
Save secretrobotron/3501165 to your computer and use it in GitHub Desktop.
}
return fragment;
},
transitionEndWrapper: (function() {
var div = document.createElement( "div" ),
p,
pre = [ "ms", "O", "Webkit", "Moz", "" ];
// Check for CSS3 Transition support
/*jshint loopfunc:true */
for ( p in pre ) {
if ( div.style[ pre[ p ] + "Transition" ] !== undefined ) {
return function( element, listener ) {
element.addEventListener( "transitionend", listener, false );
element.addEventListener( "oTransitionEnd", listener, false );
element.addEventListener( "WebkitTransitionEnd", listener, false );
};
}
}
/*jshint loopfunc:false */
// Fallback on setTimeout
return function( element, listener ) {
setTimeout( listener, DEFAULT_TRANSITION_TIMEOUT );
};
}())
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment