4 ms·
Collapsible section? https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details https://developer.mozilla.org/en-US/docs/Web/HTML/Element/de... There's
by chipsa 4y ago
Collapsible section? https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details https://developer.mozilla.org/en-US/docs/Web/HTML/Element/de...
There's some CSS transition stuff you can add to that to make it lightly animated: https://css-tricks.com/how-to-animate-the-details-element/ https://css-tricks.com/how-to-animate-the-details-element/
Yeah, jQuery might make some things easier, but when possible, using native HTML elements makes things even easier,
- nhinck 4y agoHmm, I would agree that you can do 95%+ of stuff jQuery used to be used for in vanilla js or html/css in a nicer way but animated collapsible divs still require a stupid amount of js to achieve.
- deleted 4y ago[deleted]
- iCarrot 4y agoAnimated collapsible div can be done with 0 line of JS. https://code-boxx.com/expand-collapse-div-css-only/ https://code-boxx.com/expand-collapse-div-css-only/
- nhinck 4y agoUhh, did you check out how that actually functions? It looks like garbage.
- ThunderSizzle 4y agoAgreed, this example looks like total shit.