Menu icon Foundation
Clicking to open and close tabs

Is it possible to open + close tabs by clicking?

I've found the hover (auto) open function but I hope there is also an easy way to remove the .active class on the second click ( or a tab that already is opened ).

tabsopenclose

Is it possible to open + close tabs by clicking?

I've found the hover (auto) open function but I hope there is also an easy way to remove the .active class on the second click ( or a tab that already is opened ).

Jacob Pope about 5 years ago

Try this bit of jQuery, where .tabclass is your tab class name:

 $( ".tabclass" ).click(function() {
  $( this ).toggleClass( "active" );
});