Design comparison
SolutionDesign
Solution retrospective
what is your approach in making design responsive ?
Community feedback
- @JanselLopezPosted almost 2 years ago
- I think the idea is to show only once at a time, so you can do this in your js code:
const btn = document.querySelectorAll(".contentbox"); let current; btn.forEach((element) => { element.addEventListener("click", () => { if (current && current != element) { current.classList.toggle("show"); } element.classList.toggle("show"); current = current === element ? undefined : element; }); });
1@Vedavyas11062004Posted almost 2 years ago@JanselLopez Thank you for the suggestion it is really helpful to improve the project.
0
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