Skip to content

Instantly share code, notes, and snippets.

@kmtr
Created November 17, 2011 12:49
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 kmtr/1373062 to your computer and use it in GitHub Desktop.
Save kmtr/1373062 to your computer and use it in GitHub Desktop.
jquery.plugin.template.js
(function (jQuery) {
var value1 = 'default';
//('#hoge').myplugin({value1:'foo'})
jQuery.fn.myplugin = function (options) {
var options = jQuery.extend({
value1: value1
}, options);
value1 = options.value1;
this.each(
function () {
});
};
//('#hoge').publicMethod(arg, options)
jQuery.fn.publicMethod = function (arg, options) {
var options = jQuery.extend({
}, options);
this.each(
function () {
});
}
function privateMethod() {
}
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment