Design comparison
Solution retrospective
Hey All,
Here is my next experimentation and honestly I am not very satisfied with the result. The task was more difficult than I expected it to be, here are my main problems and questions:
-
I used absolute positioning for the social media share pop-up and a separte one for the caret down. Any suggestions on how could I have done it better?
-
In JavaScript, I applied a click event on the css selector named "hidden", which includes both social media box and the caret down, but somehow the caret down doesn't appear when clicked on the icon. Why is that?
-
I was suffering with making it responsive and I think the result is just terrible. Any tips on how to be more precise and effective?
Thanks a lot for checking it out,
Wishing you all great practice,
Dalma
Community feedback
- @matiasluduena23Posted about 1 year ago
Hi @bdal90, Nice work! Just one advice.
- You can add a class call active to open and close the social icons. In your css file use
.social-media {display: none}
and add the class.social-media.active{ display: block}
to show the icons. And with javascript add the class with the toggle propperty
const shareBtnEl = document.querySelector('.share') const socialMediaEl = document.querySelector('.social-media') shareBtnEl.addEventListener('click', () => { socialMediaEl.classList.toggle('active') })
your social will open and close on click. This video could help you with JS link
If you want a good course for responsive layout do this It help me. Good code
Good code!
Marked as helpful0 - You can add a class call active to open and close the social icons. In your css file use
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