Skip to content

Instantly share code, notes, and snippets.

@haggen
Created May 14, 2011 02:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save haggen/971687 to your computer and use it in GitHub Desktop.
Save haggen/971687 to your computer and use it in GitHub Desktop.
jQuery plugin simple boilerplate
/**
* jQuery plugin simple boilerplate v1.0
* by Arthur Corenzan <arthur@corenzan.com>
* Creative Commons-Attribution-Share Alike
* http://creativecommons.org/licenses/by-sa/3.0
*/
(function($) {
//name your plugin
$.fn.PLUGIN = function(o) {
o = $.extend({
//default options
}, o);
//definitions/setup/unique stuff
return this.each(function(i, that) {
$that = $(that);
//bind/repetitive stuff
});
};
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment