Collapse
Toggle the visibility of content across your project with a few classes and our JavaScript plugins.
Preme tesserae infra monstrant et celant aliud elementum per mutationes ordinis:
.collapse
celat content.collapsing
applicatur in transitus.collapse.show
ostendit content
Vinculum uti potes cum href
attributo, vel globo cum data-target
attributo. Utroque, opus data-toggle="collapse"
est.
<p>
<a class="btn btn-primary" data-toggle="collapse" href="#collapseExample" role="button" aria-expanded="false" aria-controls="collapseExample">
Link with href
</a>
<button class="btn btn-primary" type="button" data-toggle="collapse" data-target="#collapseExample" aria-expanded="false" aria-controls="collapseExample">
Button with data-target
</button>
</p>
<div class="collapse" id="collapseExample">
<div class="card card-body">
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident.
</div>
</div>
A <button>
vel <a>
elementa multa monstrare et occultare possunt, ea referendo cum electore JQuery in suo href
vel data-target
attributo. Multiplex <button>
vel <a>
demonstrare et abscondere elementum potest, si unumquemque referat cum suo href
vel data-target
attributo
<p>
<a class="btn btn-primary" data-toggle="collapse" href="#multiCollapseExample1" role="button" aria-expanded="false" aria-controls="multiCollapseExample1">Toggle first element</a>
<button class="btn btn-primary" type="button" data-toggle="collapse" data-target="#multiCollapseExample2" aria-expanded="false" aria-controls="multiCollapseExample2">Toggle second element</button>
<button class="btn btn-primary" type="button" data-toggle="collapse" data-target=".multi-collapse" aria-expanded="false" aria-controls="multiCollapseExample1 multiCollapseExample2">Toggle both elements</button>
</p>
<div class="row">
<div class="col">
<div class="collapse multi-collapse" id="multiCollapseExample1">
<div class="card card-body">
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident.
</div>
</div>
</div>
<div class="col">
<div class="collapse multi-collapse" id="multiCollapseExample2">
<div class="card card-body">
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident.
</div>
</div>
</div>
</div>
Utens charta componente, mores ruinae defaltae extendere potes ad concordiam creandam.
<div id="accordion">
<div class="card">
<div class="card-header" id="headingOne">
<h5 class="mb-0">
<button class="btn btn-link" data-toggle="collapse" data-target="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
Collapsible Group Item #1
</button>
</h5>
</div>
<div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion">
<div class="card-body">
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
</div>
</div>
</div>
<div class="card">
<div class="card-header" id="headingTwo">
<h5 class="mb-0">
<button class="btn btn-link collapsed" data-toggle="collapse" data-target="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo">
Collapsible Group Item #2
</button>
</h5>
</div>
<div id="collapseTwo" class="collapse" aria-labelledby="headingTwo" data-parent="#accordion">
<div class="card-body">
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
</div>
</div>
</div>
<div class="card">
<div class="card-header" id="headingThree">
<h5 class="mb-0">
<button class="btn btn-link collapsed" data-toggle="collapse" data-target="#collapseThree" aria-expanded="false" aria-controls="collapseThree">
Collapsible Group Item #3
</button>
</h5>
</div>
<div id="collapseThree" class="collapse" aria-labelledby="headingThree" data-parent="#accordion">
<div class="card-body">
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
</div>
</div>
</div>
</div>
Vide ut aria-expanded
elementum ad imperium addere. Hoc attributum explicite significat praesentem statum collapsibilis elementi ligatum ad potestatem legentium protegendi et similes technologias adiuvandas. Si elementum collapsibile clauditur per defaltam, attributum in elementi potestate valorem habere debet aria-expanded="false"
. Si elementum collapsibile posueris ut pateat per defaltam utens show
classium, aria-expanded="true"
in dicione pones. Plugin sponte toggle hoc attributum in potestate fundatur utrum elementum collapsibile vel non apertum vel clausum (per JavaScript, vel quia utens utitur alia potestate elementi etiam ad idem collapsbile elementum ligatum). Si elementum HTML elementi potestate non est felis (exempli gratia, an <a>
vel <div>
) attributumrole="button"
addatur elemento.
Si elementum imperium tuum unum elementum collapsibile oppugnat - id est data-target
attributum designat id
electoris - attributum debetis elementi temperantiae, elementi collapsibilis aria-controls
continentis . id
Lectores screen moderni et similes technologiae adiuvantes hoc attributo utuntur ut usores cum brevibus additis praebeant ut directe navigant ad elementum ipsum collapsibile.
Nota quod Bootstrap exsecutio currentis non tegit varias interationes claviaturas descriptos in WAI-ARIA Authoring Exercitia 1.1 exemplaris accordionis - has te includere oportet cum usu JavaScript.
In ruina plugin paucae classes adhibet ad tractandum elevatio gravis;
.collapse
celat contentus.collapse.show
ostendit contentus.collapsing
additur quando transitus incipit, et quando finitur removetur
Hae classes reperiuntur in _transitions.scss
.
Adde data-toggle="collapse"
modo et data-target
elemento, ut automatice imperium unum vel plura elementa collapsibilia assignent. Attributum data-target
CSS electrix acceptat ut ruinam adhiberet. Adde genus collapse
elementi collapsibili. Si vis aperta defaltam facere, additamenta classis adde show
.
Accordion-similis coetus administrationem addere aream collapsibilem, data attributum addere data-parent="#selector"
. Hoc in actione refer ad demo.
Admitte cum manually:
Optiones transigi possunt per data attributa vel JavaScript. Data enim attributa, adiungunt optionis nomen data-
, ut in data-parent=""
.
Nomen | Type | Default | Descriptio |
---|---|---|---|
parent | selector | jQuery object | dom elementum | falsus | Si parens provideatur, omnia elementa collapsibilia sub parente praefinito claudentur, cum haec collapsibilis item demonstratur. (similis morum accordion traditio - hoc genus dependet card ). Attributum in area scopo collapsibile apponendum est. |
toggle | Boolean | verum | Toggles collapsible elementum in invocatione |
Modi asynchronous et transitus
Omnes API modi asynchroni sunt et transitus committitur . Redeunt ad RECENS mox ut transitus incipiat sed antequam finiatur . Methodus praeterea in transitus transeuntis ignorabitur .
Contentum actuat tuum ut collapsibile elementum. Acceptat optiones libitum object
.
Toggles collapsibile elementum est ut vel absconditum ostendatur. RECENS, antequam elementum collapsibile redit, actu ostensum est vel absconditum (id est ante eventum shown.bs.collapse
vel hidden.bs.collapse
eventum).
Elementum collapsibile ostendit. RECENS redit ad elementum collapsibile antequam actu ostensum est (id est antequam shown.bs.collapse
evenit).
Cras lacinia elementum consequat. Recurrit ad RECENS antequam elementum collapsibile actu absconditum (id est antequam hidden.bs.collapse
evenit).
Destruit elementum ruina.
Classis ruina Bootstrap paucas eventus exponit pro hamo in ruina functionis.
Event Type | Descriptio |
---|---|
show.bs.collapse | Huius rei accendit statim cum show instantia methodus appellatur. |
shown.bs.collapse | Eventus hic accensus est cum elementum ruinae usoris manifestatum est (exspectabit CSS transitus ad perficiendum). |
hide.bs.collapse | Ea res statim cum hide modus vocatus est accenditur. |
hidden.bs.collapse | Eventus hic accensus est cum elementum ruinae ab utentis absconditum est (exspectabit CSS transitus ad perficiendum). |