@A7MEDC7Submitted 11 months ago
not easy at all but I learned something
not easy at all but I learned something
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!