Submitted almost 2 years ago
Flex-Grid Intro section with dropdown nav
@ikennarichard
Design comparison
SolutionDesign
Solution retrospective
Pls why does the hamburger .menu_icon translate function work with "this" but dosen't work with "e.target" ? I thought they both refer to the element
Community feedback
- @ShuvalovrusPosted almost 2 years ago
Colback takes a single parameter based Event describing an event that happened. So that we can use e.targer, we need to rewrite the code like this
menuIcon.addEventListener('click', menuSlide);
function menuSlide(e) { e.target.classList.toggle('change'); cover.classList.toggle('show_cover'); extraLayer.classList.toggle('show_cover'); }
Marked as helpful1
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