Class: Accordion

Responsiville. Accordion

A responsive accordion for the Responsiville framework. An accordion is a drawer-like user interface element with multiple container which can be open one or many at a time.

new Responsiville.Accordion(options)

Creates and initialises the accordion.
Name Type Description
options Object The initialisation options of the module.
Properties:
Name Type Description
options Object The options that define the object behaviour.
Properties
Name Type Description
exclusive boolean Whether multiple accordion panels accordion can be simultaneously open or not.
slug boolean A special codename for the instance of the element, to be used as a class on its container and as a key in arrays where it is grouped with other elements of its kind.
debug boolean Whether to print debug messages in the browser console.
container string Selector for the element that contains the accordion contents. It is also possible to pass a DOM element or a jQuery object here as well.
panel string Selector for the element that contains each independent accordion part.
openClass string Class added to each accordion panel when it is opened.
openingClass string Class added to an open accordion panel while it is being closed.
closingClass string Class added to a closed accordion panel while it is being opened.
header string Selector for the header element of each accordion panel.
excerpt string Selector for the optional excerpt element of each panel.
content string Selector for the content element of each panel.
footer string Selector for the footer element of each accordion panel.
effect string The effect to use when opening and closing each accordion panel (none, slide, fade).
duration int The amount of time that the opening and closing of each accordion panel takes.
delay int The amount of time to delay before beginning opening or closing each accordion panel.
startAt int The index of the panel to show as open in the beginning (zero or negative for none).
enter string Comma separated list of breakpoints in which the accordion enters, wihch means it is enabled.
leave string Comma separated list of breakpoints in which the accordion leaves, which means it is disabled.
Author:
  • Nevma, info@nevma.gr
License:
  • Nevma Copyright (c) http://www.nevma.gr
Fires:

Extends

Members

staticResponsiville.Accordion.AUTO_RUN

Properties:
Name Type Description
AUTO_RUN boolean Controls whether this module should run by default, without the developer calling it, using its default settings. Defaults to true.

staticResponsiville.Accordion.defaults

Properties:
Name Type Description
defaults Object Default values for this module settings.

Methods

staticResponsiville.Accordion.autoRun(){void}

Runs through the page and searches for elements that apply to the current module in order to apply it to them automatically. Useful for automatically creating elements with this module's behaviour just by setting up the predefined classes and data attributes in HTML elements of the page.
Returns:
Type Description
void

closePanel($panel){void}

Closes and hides the contents of an accordion panel.
Name Type Description
$panel jQuery The accordion panel jQuery object whose contents are to be hidden.
Fires:
Returns:
Type Description
void
Disables the accordion.
Fires:
Returns:
Type Description
void
Enables the accordion.
Fires:
Returns:
Type Description
void

headerClick(event){void}

Handles the click event on an accordion panel header element.
Name Type Description
event Event The user click event sent by the browser.
Returns:
Type Description
void

openPanel($panel){void}

Opens and shows the contents of an accordion panel.
Name Type Description
$panel jQuery The accordion panel jQuery object whose contents are to be shown.
Fires:
Returns:
Type Description
void

setupEvents(){void}

Sets up event handlers necessary for the object to function properly.
Returns:
Type Description
void

setupEvents(){void}

Sets up event handlers necessary for the object to function properly.
Returns:
Type Description
void

Events

Called after the panel has closed.
Called after the panel has closed.
Called after the panel has closed.
Called before closing the panel.
Called after the accordion has been disabled.
Called after the accordion has been enabled.
Called after the module has been initialised.
Called after the module has been initialised.
Called after the panel has been opened.
Called after the panel has been opened.
Called after the panel has been opened.
Called before opening the panel.