Skip to content

Instantly share code, notes, and snippets.

@RyanNutt
Created December 18, 2020 15:40
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 RyanNutt/46aa99086d904782b201772412a6ba42 to your computer and use it in GitHub Desktop.
Save RyanNutt/46aa99086d904782b201772412a6ba42 to your computer and use it in GitHub Desktop.
jQuery showIf / hideIf plugin
(function ($) {
$.fn.showIf = function (check) {
if (check) {
$(this).show();
}
else {
$(this).hide();
}
};
$.fn.hideIf = function (check) {
if (check) {
$(this).hide();
}
else {
$(this).show();
}
}
}(jQuery));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment