Collapse · Bootstrap | bootstrap sidebar collapse
TogglethevisibilityofcontentacrossyourprojectwithafewclassesandourJavaScriptplugins.HowitworksThecollapseJavaScriptpluginisusedtoshowandhidecontent.Buttonsoranchorsareusedastriggersthataremappedtospecificelementsyoutoggle.Collapsinganelementwillanimatetheheightfromit’scurrentvalueto0.GivenhowCSShandlesanimations,youcannotusepaddingona.collapseelement.Instead,usetheclassasanindependentwrappingelement.ExampleClickthebuttonsbelowtoshowandhideanotherelementviaclasschanges:.collapsehidescontent.c...
Toggle the visibility of content across your project with a few classes and our JavaScript plugins.
How it worksThe 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 it’s 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.
ExampleClick the buttons below to show and hide another element via class changes:
.collapse hides content .collapsing is applied during transitions .collapse.show shows contentYou can use a link with the href attribute, or a button with the data-target attribute. In both cases, the data-toggle="collapse" is required.
Link with href [1] Button with data-target
Anim pariatur cliche reprehenderit, en...