Created
February 16, 2010 06:14
-
-
Save DylanFM/305339 to your computer and use it in GitHub Desktop.
This file contains 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($) { | |
$.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