Skip to content

Instantly share code, notes, and snippets.

@jameshoward
Created March 6, 2013 11:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jameshoward/5098702 to your computer and use it in GitHub Desktop.
Save jameshoward/5098702 to your computer and use it in GitHub Desktop.
MooTools conditional class add/remove function
Element.implement({
conditionalClass: function(className, condition) {
if (condition) {
this.addClass(className);
} else {
this.removeClass(className);
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment