Skip to content

Instantly share code, notes, and snippets.

@joecritch
Created August 1, 2011 11:16
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 joecritch/1117959 to your computer and use it in GitHub Desktop.
Save joecritch/1117959 to your computer and use it in GitHub Desktop.
// Helper classes
$.fn.changeClass = function(className, add) {
add = add || false;
return this.each(function() {
if(add) {
$(this).addClass(className);
}
else {
$(this).removeClass(className);
}
});
};
$.fn.changeVisibility = function(show) {
show = show || false;
return this.each(function() {
if(show) {
$(this).show();
}
else {
$(this).hide();
}
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment