Class: Accordion

Accordion()

A model representing an accordion with nested accordion items

Constructor

new Accordion()

Since:
  • 2.31.0
Source:

Extends

  • Backbone.Model
  • Backbone.Model

Members

type

Source:

Methods

defaults() → {object}

Note: Do not set a "easing" attribute on this model. It seems to break semanticUI accordion.
Properties:
Name Type Description
exclusive boolean Only allow one section open at a time.
on string Event on title that will cause accordion to open. Commonly set to "click".
animateChildren boolean Whether child content opacity should be animated. Note: may cause performance issues with many child elements.
closeNested boolean Close open nested accordion content when an element closes.
collapsible boolean Allow active sections to collapse.
duration number Duration in milliseconds of the opening animation.
onOpening function Callback function before an element opens. Takes the active content as an argument.
onOpen function Callback function after an element is open. Takes the active content as an argument.
onClosing function Callback function before an element closes. Takes the active content as an argument.
onClose function Callback function after an element is closed. Takes the active content as an argument.
onChanging function Callback function before an element opens or closes. Takes the active content as an argument.
onChange function Callback function when an element opens or closes. Takes the active content as an argument.
styled boolean Whether to use Semantic UI styles for the accordion.
inverted boolean Whether to use an inverted color scheme for the accordion (dark background with light text).
fluid boolean Whether the accordion should take up the full width of its container.
Source:
See:
Returns:
Default attributes for an Accordion model.
Type
object

getChildren(id) → {Array.<AccordianItem>}

Get the children of an item by its id
Parameters:
Name Type Description
id string The id of the parent item
Source:
Returns:
An array of AccordianItem models
Type
Array.<AccordianItem>

getRootItems() → {Array.<AccordianItem>}

Get the root items of the accordion. Root items are those without a parent attribute or with an empty string as the parent attribute.
Source:
Returns:
An array of AccordianItem models
Type
Array.<AccordianItem>

initialize()

Source: