I am not sure what you are trying to achieve by the following two lines as this
already refers to the jQuery object.
// Access to jQuery and DOM versions of element
base.$el = $(el);
base.el = el;
First mistake here is the extra argument el
that refers to the options not to the element, so you have to remove it:
$.fn.myBgcolor = function(/* el, */ options)
And then your constructor should become like this:
$.fn.myBgcolor = function(options){
// To avoid scope issues, use 'base' instead of 'this'
// to reference this class from internal events and functions.
var base = this;
// Add a reverse reference to the DOM object
base.data("fn.myBgcolor", base);
base.init = function(){
base.options = $.extend({},$.fn.myBgcolor.defaultOptions, options);
// Put your initialization code here
};
// Sample Function, Uncomment to use
base.BGcolor = function(paramaters){
base.css("background-color", base.options.bgColor);
};
// Run initializer
base.init();
base.BGcolor();
};
See the sample here http://jsfiddle.net/7Rrs3/1/