Created
September 13, 2012 06:28
-
-
Save rosylilly/3712349 to your computer and use it in GitHub Desktop.
jQuery-tapp
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
jQuery.fn.extend({ | |
/** | |
* $('li').tapp() で console.debug に this を出力します。 | |
* | |
* func を与えることで、func(this) を実行した結果を console.debug に出力します。 | |
* | |
* @this {jQuery} | |
* @param {function(jQuery)=} func | |
* @return {jQuery} | |
*/ | |
tapp: function(func) { | |
var _this = this.clone(); | |
console.debug(func ? func.call(_this, _this) : this); | |
return this; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment