htz-collapsibles

Module: htz-collapsibles

Members

Methods

HTZ COLLAPSIBLES

Responsive-enabled, accessible collapsible content

(require("htz-collapsibles"))(element, labelExpand, labelCollapse, collapsedClassopt, expandedClassopt, bpsSelectoropt) → {Array.<HTMLElement>}

Initialize collapsible elements

Parameters
Name Type Attributes Default Description
element String

The element to initialize.

labelExpand String

The label used to describe the toggle button when the element is collapsed and the toggle button is used for expanding.

labelCollapse String

The label used to describe the toggle button when the element is expanded and the toggle button is used for collapsing.

collapsedClass String <optional>
'o-collapsible-is-collapsed'

The class to attach to the wrapper when it is collapsed.

expandedClass String <optional>
'o-collapsible-is-expanded'

The class to attach to the wrapper when it is expanded.

bpsSelector String <optional>
'body'

A selector for the element to which the active breakpoint data is attached. See htz-parse-bps-state

Returns

Returns an array of collapsible elements.

Type
Array.<HTMLElement>
License:
  • MIT

Methods

(static) getInstance(collapsible) → {module:htz-collapsibles#API}

Get the instance API of a statful button.

Parameters
Name Type Description
collapsible String | HTMLElement

The HTMLElement or the id of a collapsible element's wrapper.

Returns
  • The API to control the instance.
Type
module:htz-collapsibles#API