Skip to content

Instantly share code, notes, and snippets.

@cou929
Created July 1, 2012 10:26
Show Gist options
  • Save cou929/3027839 to your computer and use it in GitHub Desktop.
Save cou929/3027839 to your computer and use it in GitHub Desktop.
Template of jQuery Plugin
!function($) {
var namespace = 'plugin_name';
$.fn[namespace] = function(options) {
var elements = this,
settings = $.extend({
'param': 'default value'
}, options);
elements.each(function() {
// do something
});
return this;
};
}(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment