Technical Documentation Page - JS help

Technical Documentation Page - JS help
0

#1

I tried to do a hamburger menu when the screen is smaller than a certain size.
I can click the hamburger menu to show my list, but I failed to take the list back by clicking the button again.
I wonder if the logic of Js I wrote is correct?
Many thanks!


#2

@Summerflowerling Your logic looks right to me. I’m not sure why your code isn’t working.

I’m not sure if this will help or if it’s the best way to do this, but I do this by adding and removing classes, i.e. remove a hide class when clicked and add it again when clicked again using classList.

Here’s how I did this - main.js for technical documentation page


#3

Thank you for sharing.
I will try to take a look and fix it.