Created
December 18, 2020 15:40
-
-
Save RyanNutt/46aa99086d904782b201772412a6ba42 to your computer and use it in GitHub Desktop.
jQuery showIf / hideIf plugin
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
(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