Skip to content

Instantly share code, notes, and snippets.

@DylanFM
Created February 16, 2010 06:14
Show Gist options
  • Save DylanFM/305339 to your computer and use it in GitHub Desktop.
Save DylanFM/305339 to your computer and use it in GitHub Desktop.
(function($) {
$.fn.extend({
pluginName: function(options) {
// Initialise the class
new PluginClass(this, $.extend({}, $.fn.pluginName.defaults, options));
// Return this for chaining
return this;
}
});
$.fn.pluginName.defaults = {};
var PluginClass = (function() {
var self,
element,
opts = {};
function init() {
// Do stuff
};
return function(element, options) {
self = this;
element = element;
opts = options;
init();
return this;
};
}());
}(jQuery));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment