Menu icon Foundation
Open and close tab content by click

Hey guys,
I want to open and close my tabs like the accordion. First click open and second close the content third click opens again and so on.
But I'm not very familiar with javascript so I don't know if the toggle event (http://foundation.zurb.com/docs/components/tabs.html#callbacks) is necessary and how to implement it.

Do you have a clue?
http://codepen.io/amir3000/pen/mJMoMq

tabsaccordionopenclose

Hey guys,
I want to open and close my tabs like the accordion. First click open and second close the content third click opens again and so on.
But I'm not very familiar with javascript so I don't know if the toggle event (http://foundation.zurb.com/docs/components/tabs.html#callbacks) is necessary and how to implement it.

Do you have a clue?
http://codepen.io/amir3000/pen/mJMoMq

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

Jeanie Chung over 4 years ago

Hey Amir-

So currently, the tabs library isn't really set up to function that way. Right now, there is one method that handles both closing/adding the active class onto the Tab. Rafi, however, might suggest that there is a way to get the behavior that you want by styling the Accordion a certain way.

Rafi Benkual over 4 years ago
Amir over 4 years ago

Okay I think I've do a hard restart cause of my limited skills.
But anyway thanks to you Jeanie and Rafi.