jellekralt / Responsive-Tabs

Responsive Tabs is a jQuery plugin that provides responsive tab functionality. The tabs transform to an accordion when it reaches a CSS breakpoint. You can use this plugin as a solution for displaying tabs elegantly on desktop, tablet and mobile.
http://jellekralt.github.io/Responsive-Tabs/
MIT License
531 stars 228 forks source link

The "active" initialization option is ignored when rendering in mobile breakpoint #33

Closed dkemper01 closed 9 years ago

dkemper01 commented 9 years ago

The json object passed to the responsiveTabs method, used to initialize and render the responsive tab control, contains an "active" option. This option will open the active tab upon successful initialization in the desktop breakpoint of this control, but not for the mobile (tablet and phone) breakpoint;

@media only screen and (max-width: 768px) { ... }.

So, in short, active works for desktop but not for mobile.

jellekralt commented 9 years ago

Hi, Do you have the 'startCollapsed' function enabled and set to 'accordion'? This will prevent the opening of the tab that has been set in the 'active' option.

dkemper01 commented 9 years ago

Hello, Yes, I do. Please see a reproduction here: http://mvc5toazure.azurewebsites.net/Home/Contact Otherwise, I think this control is great and thank you for putting it in the public domain! Dan Date: Sun, 23 Nov 2014 11:43:13 -0800 From: notifications@github.com To: Responsive-Tabs@noreply.github.com CC: kemper001@hotmail.com Subject: Re: [Responsive-Tabs] The "active" initialization option is ignored when rendering in mobile breakpoint (#33)

Hi,

Do you have the 'startCollapsed' function enabled and set to 'accordion'? This will prevent the opening of the tab that has been set in the 'active' option.

— Reply to this email directly or view it on GitHub.

                  =
jellekralt commented 9 years ago

Hi, That's what I suspected :). Like I said, the activate function will never be called if the tab doesn't open (which is the case with a collapsed accordion). Please consider using the 'load' function if you want to call a function when the plugin loads.

oilvier commented 7 years ago

Hi,

I know this is an old issue, but I'm in the case where I want to use the load function with the option startCollapsed set to 'accordion' and it's not working when in accordion mode.

Here's a demo