Collapse Toggle the visibility of content across your project with a few classes.
The collapse JavaScript plugin is used to show and hide content. Buttons or anchors are used as triggers that are mapped to specific elements you toggle. Collapsing an element will animate the height from its current value to 0. Given how CSS handles animations, you cannot use padding on a .collapse element. Instead, use the class as an independent wrapping element. Find more facts and uses at the bootstrap official documentation.
Basic example
-
.collapsehides content -
.collapsingis applied during transitions -
.collapse.showshows content
data-targetattribute. In both cases, the data-toggle="collapse"is required.
Multiple Targets
<button>or <a>can show and hide multiple elements by referencing them with a JQuery selector in its hrefor data-targetattribute. Multiple <button>or <a>can show and hide an element if they each reference it with their hrefor data-targetattribute
Accordion example
.collapsestate using the classes .collapsed-revealand .collapsed-hiddenMake sure the
.collapsed-*classes are inside the data-toggle="collapse"element or adjacent to it
