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 Quote Link to comment https://forums.phpfreaks.com/topic/279230-jquery-function-paramtere-problem/ Share on other sites More sharing options...
Solution nogray Posted June 16, 2013 Solution Share Posted June 16, 2013 You need to add the functional parameter in your extend functions, e.g. var options = $.extend({ startTab : 1 }, options) Quote Link to comment https://forums.phpfreaks.com/topic/279230-jquery-function-paramtere-problem/#findComment-1436276 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.