Jump to content

jQuery function paramtere problem


mostafatalebi

Recommended Posts

Hello everybody

 

I have written following plugin:

(function(){   
    var cont = $("#container");
    $.fn.doTabs = function(options){
        var options = $.extend({
           startTab : 1            
        })
        return this.each(function(){
           // here goes the rest of the code
           })
        })
    }    
})(jQuery)

When I call it like this:

$("#container").doTabs();

it works.

But When I call it with a parameter passed to it, it works as if no parameter is passed.(like this:)

$("#container").doTabs({startTab: 3});

What shall I do?

 

Thanks in advance

Link to comment
https://forums.phpfreaks.com/topic/279230-jquery-function-paramtere-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.