Design comparison
SolutionDesign
Solution retrospective
Hi Everyone,
I'm stuck with making the share icon clickable again and again, it just shows the social media pop-up once and stops, not sure what is wrong, can anyone help here? Thanks,
Community feedback
- @userMatMikPosted about 2 years ago
Hi, you just over complicate this. To display/hide this share overlay you just need to add and remove class active to .clicked-profile div. The best solution to add and remove class is toggle. Your code should look like this :
document.querySelector('.share-img').addEventListener('click', () => { document.querySelector('.clicked-profile').classList.toggle('active'); })
Hope this solution will be helpful.
Marked as helpful0
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