- Rock-solid jQuery plugin template?
- base.functionName = function() {
- ....
- }
- (function($){
- $.fn.extend(
- {
- //plugin name here
- functionName: function(options)
- {
- //Settings list and the default values
- var defaults =
- {
- defaultvar1: "value",
- defaultvar2: "value"
- };
- var options = $.extend(defaults, options);
- return this.each(function()
- {
- var o =options;
- var obj = $(this);
- //do stuff here
- }
- });
- })(jQuery);