Skip to content

Instantly share code, notes, and snippets.

@andyhausmann
Created August 9, 2013 14:48
Show Gist options
  • Save andyhausmann/6194226 to your computer and use it in GitHub Desktop.
Save andyhausmann/6194226 to your computer and use it in GitHub Desktop.
(function($){
"use strict";
$.pluginName = function(el, options){
var self = this;
self.$el = $(el);
self.el = el;
self.$el.data('pluginName', self);
self.init = function(){
self.options = $.extend({},$.pluginName.defaultOptions, options);
// Initialization code goes here.
};
// Example function
//self.exampleFunction = function() {
// Example function code goes here.
//};
// Run initializer
self.init();
};
$.pluginName.defaultOptions = {
origin: 'auto',
target: 'auto'
};
$.fn.pluginName = function(options){
return this.each(function(){
(new $.pluginName(this, options));
// Want to let your plugin do even more? Put it here.
});
};
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment