Menu icon Foundation
Accordion expand all on load

Hi,

I have Marionette with latest Foundation project and I have an accordion with ul and li's.
How can I "Expand All" when accordion is loaded? (Currently only the first li is opened)

Thanks, Arshavski Alexander.

accordion

Hi,

I have Marionette with latest Foundation project and I have an accordion with ul and li's.
How can I "Expand All" when accordion is loaded? (Currently only the first li is opened)

Thanks, Arshavski Alexander.

Rafi Benkual almost 3 years ago

There are JS options you can use to do that:

 $(document).foundation({
  accordion: {
    // specify the class used for active (or open) accordion panels
    active_class: 'active',
    // allow multiple accordion panels to be active at the same time
    multi_expand: true,
  }
});

Then add the active class to all you want open on load.

Arshavski Alexander almost 3 years ago

It works. Thanks a lot.

Petr Ogurcak 11 days ago

Is there a way to do the opposite? To have all accordions on load?