- You don't need jQuery for Ajax
- Beyond jQuery
- Don't download the full version of jQuery
- jQuery's browser bug workarounds
- 129 fixes
- Coding standards & best practices
- Complete beginners guide
- jQuery Recipes Your Mom Should Know
jQuery.fn.init
jQuery.fn = jQuery.prototype
jQuery.fn.jquery // Find version- jQuery boilerplate for plugins development
- Fluidbox - Medium-like lightbox
- Animated sorting and filtering of list
- Stripe's credit card payment
- jQuery++
- iCheck - custom checkboxes
- jQuery input mask
- jQuery.extendy
- jQuery plugins 2014
git checkout tags/2.0.3
$.fn.plugin.defaults.something = false;
$.fn.plugin = function(options) {
var settings = $.extend({}, $.fn.plugin.defaults, options);
// You can use `this` inside here which refer to
// jQuery object
// For you loop, you need to use `$(this)`
return this.each(function() {
$(this).xxx
});
// If you have callback, it is better to use `call`
// and pass in the desired object for `this`
settings.onChange.call(this)
}Some examples of plugin
;(function($) {
$.fn.removeWhitespace = function() {
this.contents().filter(function() {
return (this.nodeType === 3 && !/\S/.test(this.nodeValue))
}).remove();
return this;
};
})(jQuery);