Skip to content
This repository has been archived by the owner on Aug 31, 2022. It is now read-only.

filamentgroup/Details

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⚠️ This project is archived and the repository is no longer maintained.

Details, details.

This is a feature test and polyfill for the HTML5 details/summary markup pattern, with a couple of extras:

  • Allows you to expand and collapse the details content above/below specified screen sizes
  • Adds keyboard navigation and toggling
  • Adds a bunch of ARIA goodness

Using the open attribute to default details to open/closed works as expected, naturally. To have an element only open above/below a certain size, each details element accepts a data-media attribute with a good ol’ fashioned media query in it.

I’ve included a shim for indexOf and matchMedia, both of which are required for the breakpoint behavior.

In the event that JavaScript is disabled or otherwise unavailable and details isn’t natively supported, the summary elements will simply behave like headings and all the content will be available.

It should be noted that mathiasbynens has a simple and especially robust jQuery-based test/polyfill for this markup, as well.

Demo

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published