(function($) {
$.fn.glow = function() {
return this.each(function() { //<--optionally, parameters here
// your logic here
// `this` at this point refers to the DOM element
});
}
})(jQuery); //<-- Closure to allow using $ where $ is not jQuery any more
return
в return this.each(..)
включает цепочки плагинов jQuery, так что вы можете использовать:
$("selector").glow().anothermethod();
//If return was omitted, the previous line would throw an error