HTML CSS JavaScript
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
archive
assets
docs
.gitignore
Gruntfile.js
LICENSE
README.md
index.html
package-lock.json
package.json

README.md

Accordion-Module

Accordion Ui Module with native (vanilla) javascript, adapted from 10up WP Component Library and CSS+JS Accordion to get dynamic max-height value by Aaron Bushnell

screenshot of accordion module

Demo

Minimal required HTML-markup is:

<section class="js-accordion">
  <div class="Accordion" data-accordion>
    <h3 class="accordion_header" data-title><button class="accordion_button" type="button">Alorem</button></h3>
    <div class="accordion_content" data-content>
      <h4 class="accordion_label">Alorem</h4>
      <!-- stuff -->
    </div><!-- .accordion_content -->
  </div><!-- .Accordion -->
<!-- and so on -->
</section>

Include javascript and initiate in the bottom of HTML

<script src="assets/js/all.min.js"></script>

Resources

Notes

An ealier version of this ui-module, with much simpler javaScript has been archived: see archive directory.