Design comparison
Solution retrospective
Can't believe i actually did it , anyway can some one tell me how to make the background dark when someone clicks on the hamburger... when the tab menu opens (in mobile view)
Community feedback
- @huanfsPosted about 1 year ago
to solve this problem you can do like me, i've created and variable called "wid", she's contain the width of the screen, i've used "let wid = window.availWidth", and then, in javascript i've switched the layout of menu (in mobile and desktop), according the value of wid, using an if/else conditional, is more easy controls some pieces of layout using javascript, like the menu and they background color, so you can do this think: build the desktop layout and, using javascript you can hide the menu items and create others with a different layout (for mobile) in javascript. if you have any trouble, check my solution or reply
1
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