Class: Toggler

Toggler(options)

new Toggler(options)

A class for enabling toggling

Parameters:
Name Type Description
options Object
Properties
Name Type Attributes Description
eventBus OO.EventEmitter

Object used to emit before-section-toggled and section-toggled events

$container jQuery.Object

to apply toggling to

prefix string

a prefix to use for the id.

page Page <optional>

to allow storage of session for future visits

isClosed Page <optional>

whether the element should begin closed and section-toggled events

Source:

Methods

reveal(selector, $container)

Reveals an element and its parent section as identified by it's id

Parameters:
Name Type Description
selector string

A css selector that identifies a single element

$container Object

jQuery element to search in

Source:

toggle($heading)

Given a heading, toggle it and any of its children

Parameters:
Name Type Description
$heading jQuery.Object

A heading belonging to a section

Source: