Last active
December 16, 2015 17:19
-
-
Save shaunwallace/5469500 to your computer and use it in GitHub Desktop.
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 hideElement( elem, target ) { | |
| //wrap as jquery object if it isnt one | |
| elem = elem instanceof jQuery ? elem : $( elem ); | |
| //if there is a target and that target is a function then run that function | |
| //and return the elem to hide otherwise simply hide the element | |
| target ? typeof( target ) === 'function' ? ( target(elem) ).hide() : elem.find( target ).hide() : elem.hide(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment