mostafatalebi Posted June 16, 2013 Share Posted June 16, 2013 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 More sharing options...
nogray Posted June 16, 2013 Share Posted June 16, 2013 You need to add the functional parameter in your extend functions, e.g. var options = $.extend({ startTab : 1 }, options) Link to comment https://forums.phpfreaks.com/topic/279230-jquery-function-paramtere-problem/#findComment-1436276 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.