Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

FAQ accordion using summary tag and JavaScript to add behaviors

P
Jennaâ€Ē 230

@NandiniCooppen

Desktop design screenshot for the FAQ accordion card coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


Hello, FEM community! It's been a while since I last shared a solution, but I'm excited to present my approach to the FAQ accordion challenge. ðŸĨģ

During my exploration of various methods to implement an accordion, I stumbled upon the HTML <summary> tag – a fortunate discovery as I was initially searching for ways to create an accordion without relying on JavaScript. 😎

However, I eventually incorporated JavaScript into my solution to achieve the desired behavior of having only one accordion tab open at any given time. 😅 Additionally, I utilized JavaScript to enhance the animation of the accordion. 😇

Here's a breakdown of some of the expected behavior: 😊

  • Upon loading the page, the second question/tab will automatically open, with the orange box smoothly sliding to the left while the arrow rotates upwards.
  • When opening a new tab while another remains active, the active tab will gracefully close, keeping the orange box positioned on the left.
  • Upon closing a tab, the box will elegantly slide to the right, accompanied by a downward rotation of the arrow.

While I acknowledge that these animations might not be essential to the functionality, I couldn't resist the opportunity to experiment with them. Admittedly, the animation may not appear as seamless as I envisioned. ðŸĪŠ

I'm open to any feedback, suggestions for improvement, or insights that could aid me in future projects. Specifically, I'd greatly appreciate guidance on refining the animations for a smoother effect. In addition, I'm interested in receiving overall feedback regarding the entirety of the challenge. Your input will undoubtedly contribute to my growth as a developer. 😉

Thanks 🙂

Community feedback

Please log in to post a comment

Log in with GitHub
Discord logo

Join 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