GitHunt
KO

kolappannathan/accordion

Simple Accordion done in Vanilla JS

Accordion

Simple Accordion done in Vanilla JavaScript. It is based on pinceladasdaweb's work. It is lightweight, easy to install and use.

Downloads:
GitHub release

Usage

  1. Paste right before your page's closing </body> tag:
<script type="text/javascript" src="accordion.min.js"></script>
  1. Include the css in your html page
<link rel="stylesheet" type="text/css" href="accordion.min.css">
  1. Minimum HTML to make it work:
<div class="acc-section">
    <h2 class="acc-title">Title here</h2>
    <div><!-- HTML here --></div>
    <h5 class="acc-title">Title here</h5>
    <div><!-- HTML here --></div>
    <div class="acc-title">Title here</div>
    <div><!-- HTML here --></div>
</div>

Languages

JavaScript92.8%CSS7.2%

Contributors

MIT License
Created April 23, 2018
Updated January 28, 2023