Skip to content

Instantly share code, notes, and snippets.

@davelab
Last active March 22, 2016 10:10
Show Gist options
  • Save davelab/1fdec79abaa15ec6f551 to your computer and use it in GitHub Desktop.
Save davelab/1fdec79abaa15ec6f551 to your computer and use it in GitHub Desktop.
jQuery Plugin Snippet
;(function($, window) {
'use-strict';
var pluginName = "",
defaults = {};
/**
* plugin constructor
* @param {object} parentElement the DOM of initialized plugin
* @param {object} options plugin config options
*/
function Plugin(parentElement, options) {
this.settings = $.extend({}, defaluts, options);
};
$.fn[pluginName] = function(options){
return this.each(function(){
new Plugin(this, options);
});
};
})(jQuery, window);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment