Created
August 9, 2013 14:48
-
-
Save andyhausmann/6194226 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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