Accordion
Diese Version des Accordions basiert auf den nativen Elementen details und summary. Dadurch sind Semantik und Tastaturbedienung zum Öffnen und Schließen der einzelnen Items bereits vorhanden. Geschlossene Bereiche bleiben außerdem für die Browsersuche auffindbar und werden bei einem Treffer automatisch geöffnet.
Zur alten Version (deprecated)
Default
Accordion title 1
Accordion title 2
Accordion title 3
<div class="modul-accordion accordion--native js-accordion-native">
<details class="accordion-item">
<summary class="accordion-item__heading">
<span class="title">Accordion title 1</span>
</summary>
<div class="accordion-item__panel">
<div class="text">
<div class="textile">
Philosophy is considered a science but it is difficult to say, when one has to compare with an ordinary science, for example biology, or chemistry.
</div>
</div>
</div>
</details>
<details class="accordion-item">
<summary class="accordion-item__heading">
<span class="title">Accordion title 2</span>
</summary>
<div class="accordion-item__panel">
<div class="text">
<div class="textile">
Philosophy is considered a science but it is difficult to say, when one has to compare with an ordinary science, for example biology, or chemistry.
</div>
</div>
</div>
</details>
<details class="accordion-item">
<summary class="accordion-item__heading">
<span class="title">Accordion title 3</span>
</summary>
<div class="accordion-item__panel">
<div class="text">
<div class="textile">
Philosophy is considered a science but it is difficult to say, when one has to compare with an ordinary science, for example biology, or chemistry.
</div>
</div>
</div>
</details>
</div>
Odd/Even Layout
Add class .accordion--oddeven on the .modul-accordion element to change the layout.
Accordion title 1
Accordion title 2
Accordion title 3
Multiple open
Set the attribute data-allow-multiple="true" on the .modul-accordion element to allow multiple accordion sections to be expanded at the same time
Accordion title 1
Accordion title 2
Accordion title 3
Initial open
Set the attribute open on the .accordion-item element to open that accordion element on page load.
Initial open
Initial close (default)
Initial close (default)
Toggle all
Set the attribute data-allow-toggleall="true" on the .modul-acccordion element to add an extra "toggle all" element.
You can optional change the default open/close text by adding the data-toggleall-opentext and data-toggleall-closetext attributes.