Details/summary polyfill (expandable/collapsible content)

Looking for WET v3.1?

WET v4.0 is now the current version. There is a new location for the current page in WET v3.1.

Questions or comments?

Purpose

The HTML5 details and summary elements allows content to be expanded and collapsed. Because some browsers do not support this functionality natively, this polyfill emulates the same functionality using generic HTML and WAI-ARIA.

Working example

To use the polyfill, standard details and summary elements must be used. In cases where a browser doesn't support these elements, the polyfill is automatically loaded.

Configuration options

Configuration options available for the details and summary elements (HTML5 specification)

Events

Event Trigger What it does
wb-init.wb-meter Triggered manually (e.g., $elm.trigger( "wb-init.wb.wb-meter" );). Used to manually initialize the details/summary polyfill on a summary element. Note: The details/summary polyfill will be initialized automatically unless the summary element is added after the page has already loaded.

Source code

Details/summary polyfill source code on GitHub

Ù
Date modified: