Skip to content

Instantly share code, notes, and snippets.

@redgoose-dev redgoose-dev/CSS3.js
Last active Jan 18, 2016

Embed
What would you like to do?
CSS3 Util class
/**
* CSS3 class
*/
var CSS3 = {
eventNames : {
WebkitTransition : 'webkitTransitionEnd',
MozTransition : 'transitionend',
OTransition : 'oTransitionEnd otransitionend',
transition : 'transitionend'
},
isSupport : function()
{
var el = document.createElement('div');
for (var name in this.eventNames) {
if (el.style[name] !== undefined) {
return this.eventNames[name];
}
}
el = null;
return false;
},
transitionEnd : function(el, callback)
{
if (this.isSupport())
{
if (callback)
{
$(el).one(this.isSupport(), callback);
}
}
else
{
$(el).one(this.isSupport(), callback);
}
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.