I'm not sure what's wrong, but I can't get the default options to work in my plugin.
Here's my Code
Code:
(function ($) {
$.lilRWDMenu = function (el, options) {
var base = this;
base.$el = $(el);
base.el = el;
base.$el.data("lilRWDMenu", base);
$.lilRWDMenu.defaultOptions = {
mainMenuClass: 'main-menu',
rwdMenuClass: 'rwd-mobile-menu'
};
base.init = function () {
base.options = $.extend({}, $.lilRWDMenu.defaultOptions, options);
};
base.init();
};
$.fn.lilRWDMenu = function (options) {
return this.each(function () {
var mainMenuObj = options.mainMenuClass,
rwdmenuObj = options.rwdMenuClass;
});
};
})(jQuery);
I'm not sure why but all the variables are coming up as undefined. I've written plugins before like this with no problems, but for some reason it's not working