Get help. Give help. A Web Design and Development Community.

Problem with jQuery plugin defualt options

  • # January 31, 2013 at 8:59 am

    I’m using the jQuery plugin template from [CSS-Tricks]( “CSS-Tricks”), but I’m having a problem with the default options.

    (function ($) {
    $.lilRWDMenu = function (el, options) {
    var base = this;
    base.$el = $(el);
    base.el = el;
    base.$“lilRWDMenu”, base);
    $.lilRWDMenu.defaultOptions = {
    mainMenuClass: ‘main-menu’,
    rwdMenuClass: ‘rwd-mobile-menu’
    base.init = function () {
    base.options = $.extend({}, $.lilRWDMenu.defaultOptions, options);
    $.fn.lilRWDMenu = function (options) {
    return this.each(function () {

    var mainMenuObj = options.mainMenuClass,
    rwdmenuObj = options.rwdMenuClass;
    console.log(mainMenuObj );

    For some reason the default options are coming back as ‘undefined’.

    I can’t figure out why it’s not working, so if anyone can check my code for me that’ll be great.

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

We have a pretty good* newsletter.