Lightweight Collapsible Accordion Menu Plugin collapsible - Download Lightweight Collapsible Accordion Menu Plugin - collapsible

Download Lightweight Collapsible Accordion Menu Plugin – collapsible

Posted on

This time I will share jQuery Plugin and tutorial about Lightweight Collapsible Accordion Menu Plugin – collapsible, hope it will help you in programming stack.

Lightweight Collapsible Accordion Menu Plugin collapsible - Download Lightweight Collapsible Accordion Menu Plugin - collapsible
File Size: 8.08 KB
Views Total: 4170
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

collapsible is a very small jQuery plugin used to create a vertical collapsible or accordion menu that allows the visitor to open multiple (or single) menu items at the same time.

How to use it:

1. Load jQuery library and the jQuery collapsible plugin’s JS & CSS files in the html document.

1 <link href="collapsible.css" rel="stylesheet">
2 <script src="//code.jquery.com/jquery.min.js"></script>
3 <script src="jquery.collapsible.js"></script>

2. Create menu headers and body following the markup structure like this:

01 <div id="demo" class="collapse-container">
02   <h3>
03     <span class="arrow-r">
04     </span>
05     First Heading
06   </h3>
07   <div>
08     <p>First Section</p>
09   </div>
10   <h3>
11     <span class="arrow-r">
12     </span>
13     Second Heading
14   </h3>
15   <div>
16     <p>Second Section</p>
17     <p>Second Section</p>
18   </div>
19   <h3>
20     <span class="arrow-r">
21     </span>
22     Third Heading
23   </h3>
24   <div>
25   </div>
26 </div>

3. Initialize the plugin to create a default collapsible menu.

1 $('#demo').collapsible();

4. Initialize the plugin to create an accodrion menu.

1 $('#menu').collapsible({
2   accordion: true
3 });

5. Open a specified menu item on page load.

1 $('#menu').collapsible({
2   contentOpen: 0 // menu item 1
3 });

6. More configuration options with default values.

01 $('#menu').collapsible({
02    
03   // animation options
04   animate: true
05   accordionUpSpeed: 400,
06   accordionDownSpeed: 400,
07   collapseSpeed: 400,
08  
09   // CSS classes for arrows
10   arrowRclass: 'arrow-r',
11   arrowDclass: 'arrow-d',
12    
13 });

Change log:

2017-06-01


This awesome jQuery plugin is developed by jordnkr. For more Advanced Usages, please check the demo page or visit the official website.

source : jqueryscript.net