Skip to content

Instantly share code, notes, and snippets.

@db
Created February 1, 2011 06:48
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 db/805515 to your computer and use it in GitHub Desktop.
Save db/805515 to your computer and use it in GitHub Desktop.
basic jquery plugin pattern
(function($){
$.fn.basicPlugin = function(options) {
var defaults = {
prop1 : 'value1',
prop2 : 'value2',
};
var settings = (options) ? $.extend({},defaults,options) : defaults;
return this.each(function(index, element){
// my plugin code here
});
};
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment