Package Manager:
bower install --save accordion-js
Usage:
$('.accordion').accordion();
For a simple accordion/dropdown, use the following structure:
<div class="accordion">
<div class="accordion-control">...</div>
<div class="accordion-content">
// content
// content
</div>
</div>
Use figures to display the states of the accordion.
Simple example of use of class .opened
.accordion-control {
background-image: url('plus.svg');
}
.accordion-control.opened {
background-image: url('minus.svg');
}
controlElement
Element that will act as a button.
type: element
default: $('.accordion-control')
contentElement
Element that contains hide/show content.
type: element
default: $('.accordion-content')
transitionSpeed
Transition speed on miliseconds.
type: int
default: 400
ease
The type of "easing" to use during transitions. [Try out the demo]
type: string
default: 'swing'
multipleCollapse
Sets the number of collapse to be opened. [Try out the demo]
type: boolean
default: true
onOpened
Executes immediately after the accordion is fully opened. [Try out the demo]
type: function() {}
options: function(el) { // your code here }
argument:
el: current element clicked.
onClosed
Executes immediately after the accordion is fully closed. [Try out the demo]
type: function() {}
options: function(el) { // your code here }
argument:
el: current element clicked.