Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

new home page main scss js

@Uriasmanu

Desktop design screenshot for the News homepage coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
2junior
View challenge

Design comparison


SolutionDesign

Solution retrospective


Could someone assist me in solving this issue with the dropdown menu in the mobile version? It's closing when clicking anywhere within the "container-navbar" div. It was working correctly before, but at some point, this started happening, and I'm unable to fix it.

Community feedback

ML Imad 140

@MLimad

Posted

Hello .. From your code Html remove input checkbox and in the script js add some changes like this

const open = document.getElementById('open'); const close = document.getElementById('close'); const menu = document.getElementById('container'); const page = document.getElementById('page'); const navebar = document.getElementById('navebar');

// Open DropDown open.addEventListener('click', function() { open.style.display = 'none'; close.style.display = 'block'; menu.style.display = 'block'; }); // Close DropDown close.addEventListener('click', function() { open.style.display = 'block'; close.style.display = 'close'; menu.style.display = 'none'; });

like you see i removed input variable and i created two functions one for open the dropdown and the other for close it

0

Please log in to post a comment

Log in with GitHub
Discord logo

Join 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