Load all Toolset Layouts Accordion Panels in collapsed state

By default, Toolset Accordions made with Toolset Layouts will expand the first panel of an accordions cell.

This is as well the default in native Bootstrap 3.

If you want to have all Panels collapsed when you load the page initially, and only open each panel on click, you can add this JS to the Toolset > JS/CSS editor:

jQuery('[id^=ddl-panel_]').removeClass('in');

What we do with the code above is targeting every accordion body produced and remove the “in” class.
Since Toolset Layouts automatically generates the ID with a random number I used a wildcard to address the hardcoded Toolset Layouts Accordion body prefix:

ddl-panel_

 


Let us know if this snippet is not working for you:

This snippet doesn’t work
0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments