Created
March 6, 2013 11:31
-
-
Save jameshoward/5098702 to your computer and use it in GitHub Desktop.
MooTools conditional class add/remove function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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