View Code? Open in Web Editor
NEW
Toggle the state of a UI element to easily create components e.g. collapse, accordion, tabs, dropdown, dialog/modal.
Home Page: https://nigelotoole.github.io/tiny-ui-toggle/
License: MIT License
JavaScript 20.37%
HTML 27.69%
CSS 51.93%
tiny-ui-toggle's People
Contributors
Watchers
tiny-ui-toggle's Issues
Since the <details>
element also has a "toggle" event. If you add the event listener below:
document . querySelector ( 'details.toggle-panel' ) . addEventListener ( 'toggle' , ( { target } ) => console . log ( target . open ) ) ;
When you open the panel, the console looks like this:
Where as opening a normal <details>
element would look like this:
I love that you added in animation for <details>
since that is sorely needed.