Created
August 5, 2014 23:09
-
-
Save josefglatz/ab3c47aa42c289cb48e9 to your computer and use it in GitHub Desktop.
jQuery tiny "exists" plugin
This file contains 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
/* | |
* if exists method - a tiny jquery plugin <3 | |
* by Josef Florian Glatz <[email protected]> | |
* | |
*/ | |
$.fn.exists = function(callback) { | |
var args = [].slice.call(arguments, 1); | |
if (this.length) { | |
callback.call(this, args); | |
} | |
return this; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment