Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-29-2013, 06:28 PM   PM User | #1
gilgimech
New Coder

 
Join Date: Mar 2010
Posts: 58
Thanks: 10
Thanked 3 Times in 3 Posts
gilgimech is an unknown quantity at this point
Help With jQuery PLugin Default Options

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

Last edited by gilgimech; 01-31-2013 at 06:00 AM..
gilgimech is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:57 PM.


Advertisement
Log in to turn off these ads.