Menu icon Foundation
Accordion Foundation 5

Hi everyone! Todd emailed us a question about accordions. Thanks!

--

The way these currently work, you put the "active" class on the content DIV.

<dd> 
<a href="#panel1">Title</a> 
<div id="panel1" class="content active">Content</div> 
</dd> 

            

         

I'm not sure why that is. Putting the "active" on the parent DD would
allow me to easily stylize the title as well.

<dd class="active"> 
<a href="#panel1">Title</a> 
<div id="panel1" class="content">Content</div> 
</dd> 

         

Am I missing something? I don't see a hook or scss var to let me do that.

Thanks!

Todd

accordionactive

Hi everyone! Todd emailed us a question about accordions. Thanks!

--

The way these currently work, you put the "active" class on the content DIV.

<dd> 
<a href="#panel1">Title</a> 
<div id="panel1" class="content active">Content</div> 
</dd> 

            

         

I'm not sure why that is. Putting the "active" on the parent DD would
allow me to easily stylize the title as well.

<dd class="active"> 
<a href="#panel1">Title</a> 
<div id="panel1" class="content">Content</div> 
</dd> 

         

Am I missing something? I don't see a hook or scss var to let me do that.

Thanks!

Todd

This post has been closed. No new replies can be added.

Rafi Benkual over 5 years ago

No you're not missing anything. Looks like we need to update the active class on dd instead of div id. We will add that to the 5.1 release. Thanks!

Luca Spanò over 5 years ago

I'm waiting for this useful addons!!!
Thanks!

Gideon Banez over 5 years ago

yes please! i was banging my head on the desk all day yesterday until i realized .active was only getting applied to the div#panel

however, in your samples .active is getting applied to dd.

are the docs ahead of the production release then??

Kaela over 5 years ago

Can someone post the code that would be updated to fix this? I don't want to have to write around something that adds the class "active" if it'll cause issues in the next update.

Ram Balakrishnan over 5 years ago

Any word on this yet? It seriously limits use of the accordion in Foundation at the moment.

Gene M over 5 years ago

Any chance someone from Foundation can post a quick fix for this before 5.1?

Thank you!

Rafi Benkual over 4 years ago

This was updated in 5.1.