Design comparison
Solution retrospective
not easy at all but I learned something
Community feedback
- @ChomikensPosted 11 months ago
Hi! I see you did a great job here!
If you want some smoth animation for open and close state you can set accordion content to 0 height and set overflow hidden. Then add inner content element to it when you add padding and rest of style.
Why this ? When you animate height you create JANK. When you dont put inner content you also animate padding.
When you see something like this: Elements.forEach(element => { element.addEventListener} Insted of this you can try event delegation pattern.
You add Event Listener do first common parent element end designete the event target.
If you want to look at solution feel free to check mine. Also if you have question feell free to ask!
Hope you have a great day!
Marked as helpful1
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord