Ayodeji Posted July 6, 2018 Share Posted July 6, 2018 I am working on a new website for my wife. I tried to make it mobile responsive by using the w3css collapsible navbar with its accompanying javascript and it was working fine. I later tried to make the navbar sticky to improve on the user experience. On introducing the sticky navbar with its accompanying javascript, it becomes sticky on both desktop and mobile but the menu button on mobile stopped working although it is displayed. file.html Link to comment Share on other sites More sharing options...
Funce Posted August 16, 2018 Share Posted August 16, 2018 On 7/7/2018 at 8:56 AM, Ayodeji said: I am working on a new website for my wife. I tried to make it mobile responsive by using the w3css collapsible navbar with its accompanying javascript and it was working fine. I later tried to make the navbar sticky to improve on the user experience. On introducing the sticky navbar with its accompanying javascript, it becomes sticky on both desktop and mobile but the menu button on mobile stopped working although it is displayed. file.html It seems you've defined `myFunction()` twice. When you're trying to make the page sticky, you've overridden the function which makes the menu work. I suggest changing the first `myFunction()` to a more descriptive name like `toggleMenu()` and change the menu button onclick method to also use toggleMenu. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now