Hello,

I am attempting to use QuickTabs for a somewhat unconventional interface. One thing I want to do is have all the tabs collapsed by default. That is, there is no quicktab content showing when the page loads. The tab content would only appear when the user clicks on one of the tab labels.

Is this possible? What would be the best way to approach this?

Thanks for any help!

Comments

megan_m’s picture

Category: support » feature

Changed category from support request to feature request.

I have built in in some code for this but it needs some work. If you will accept a patch for this I can get it cleaned up.

vgulla’s picture

Issue tags: +quicktab collapsed

I am interested in this too. Please send patch

johaziel’s picture

Version: 6.x-2.x-dev » 7.x-3.x-dev

I am interested in this too in D7 if possible.
Thanks,

stevebab’s picture

This would be very helpful. Any chance you could post your code @drupalchick ?

megan_m’s picture

StatusFileSize
new9.05 KB

I don't work for the company I developed this for anymore, but I do have a backup of the code. I can't remember exactly what I modified, though, and this was over a year ago, so I have no idea if this will work with the current version. It was developed in Drupal 6.

Attached is the modified quicktabs.js file I was using. At line 152 there are some comments with what I changed. As I had it working, it was just collapsing all the tabs by default. I was thinking of building in an interface option for that but never got around to it.

gocaps’s picture

gocaps’s picture

Using the accordion quicktab style, this can be achieve with jquery.

http://stackoverflow.com/questions/4633971/how-do-i-keep-jquery-ui-accor...

rattusrattus’s picture

The attached patch will alter the module to give the option to 'Collapse on load'.

Everett Zufelt’s picture

Status: Active » Needs review

Colleague testing patch.

Everett Zufelt’s picture

Status: Needs review » Reviewed & tested by the community

Tested and works as designed.

akbryan’s picture

I applied this yesterday. Works great for me too. Thank you!

helpmelearn’s picture

great worked

shiraz dindar’s picture

same patch as #8 with trailing whitespace removed

Road Kill’s picture

Has anybody worked this out for the quick tabs option.

cafuego’s picture

Works as advertised and very useful. Can this be applied please?

kaidjohnson’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new1.34 KB

Per comment #14 and because the patch posted in #8 is specific only to the ui accordion renderer, I've taken a slightly different approach to include both the ui accordion and the quicktab renderer (from what I can tell, there is no way to have no tab 'active' for the ui tabs renderer). For one of my projects, we really want to use the quicktab renderer but not have any tab active when the page loads.

Instead of adding a ui-specific setting, I've added the option to select 'none' as the default tab, which prevents both the quicktab renderer and the accordion renderer from selecting an active tab, so none is rendered and the desired effect is achieved.

ultimateboy’s picture

Title: Possible to have no default tab? » Ability to have no active tab/accordion item
Status: Needs review » Fixed

kaidjohnson, this is elegant. I like the simplicity of the code and UI changes are minimal. Thank you.

And thank you to the rest of you who helped achieve the results. May we all have tabs/accordions without an active tab!

Committed #16 to 7.x-3.x.

http://drupalcode.org/project/quicktabs.git/commit/d234dc4f0fb5716a258ad...

socceronly’s picture

Thank you so much for making this happen!

Very appreciated.

JM

Status: Fixed » Closed (fixed)
Issue tags: -quicktab collapsed

Automatically closed -- issue fixed for 2 weeks with no activity.