Responsive, CSS powered, jQuery accordion plugin
npm install jq-accordionThis is the fork of the jQuery Accordion.
Responsive, CSS powered, jQuery accordion plugin.
Jquery Accordion uses CSS transitions to animate opening/closing with a fallback to jQuery's animate when CSS transitions are not supported. It takes little configuration or code to use it on your project. Try out the demo.
Supports IE9+ and modern browsers.
Developed by Victor Fernández. Licensed under the MIT License.
bower install jq-accordion --save
// or
npm install jq-accordion --save
1. Include jQuery:
``html`
2. Include plugin's code:
`html`
3. Call the plugin:
`javascript`
$('.accordion').accordion({
"transitionSpeed": 400
});
Name | Default | Type | Description
:----------------|:---------------------------|:--------|:-----------
transitionSpeed | 300 | int | Transition speed on miliseconds.'ease'
transitionEasing | | string | CSS value for easing.'[data-control]'
controlElement | | string | CSS selector for the element acting as a button.'[data-content]'
contentElement | | string | CSS selector for the element containing hide/show content.'[data-accordion-group]'
groupElement | | string | CSS selector for a parent element containing a group.true
singleOpen | | boolean | Opens a single accordion a time.
accordion.open fires when any accordion opens
accordion.close fires when any accordion closes
accordion.toggle toggles accordion open/close when triggered on a controlElement. This will not be triggered if it affects more than one accordion while singleOpenis enabled.
For a simple accordion/dropdown, use the following structure/data-attributes:
`html`
Control
Row
Row
Row
For a group of accordions, you can use the data-accordion-group attribute on a parent, this will allow you to activate/deactivate the single open behavior by setting singleOpen to true/false.
`html`
Control
Row
Row
Row
Control
Row
Row
Row
To initialize the accordion with an open state just add the class .open to your accordion element.
`html``
Control
Row
Row
Row
Check CONTRIBUTING.md for more information.
MIT License © Nay Zaw Oo