Responsive landing page with mobile menu animation
Design comparison
Solution retrospective
I was pretty happy with this one.
The only thing is I wanted the mobile menu to go back up after I scroll down a little first. Right now, when you push the hamburger, the menu comes down, but when you scroll down, right away it goes back up, I wanted to scroll down say 200px and THEN it goes back up.
Anyway super fun to replicate and used CSS flex and CSS grid a lot.
Community feedback
- @brasspetalsPosted over 2 years ago
Hi, Trevor! Congrats on completing another solution!
If you use
window.scrollY>=400
rather thanwindow.scrollY=400
in your scroll event listener, it should work. Remember, one equals sign is not "equality" in JS. While using "===" should also work, the behavior you're really going for is to have the mobile menu move back up if the user has scrolled up to or past 400, so I think>=
is better used here.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