container element
container element
Collapse item
collapse directly without animation
return promise if animation is enabled
Destroy instance, remove all listeners
Expand item
expand directly without animation
return promise if animation is enabled
Remove an event handler for the given type.
Type of event to unregister handler
from, or "*"
Handler function to remove
Register an event handler for the given type.
Type of event to listen for, or "*"
for all events
Function to call in response to given event
Refresh
Expand the specified items with initial configuration
Toggle item
toggle directly without transition
return promise if animation is enabled
Modify the default configuration
Generated using TypeDoc
Collapsible
Example
<section id="collapse"> <div> <header>title 1</header> <article>content 1</article> </div> <div> <header>title 2</header> <article>content 2</article> </div> <div> <header>title 3</header> <article>content 3</article> </div> </section>
const collapsible = new Collapsible( document.getElementById('collapse') ); collapsible.on('collapse', ({title, content, index}) => {}); collapsible.on('expand', ({title, content, index}) => {});