I’ve been trying to use this code for preventing scroll once my nav is open.
I have the same button for menu open and close. The scroll is correctly disabled when I change the class name of the second ‘menu’. But the scroll isn’t activated when the menu is closed. It doesn’t work at all if both the class names are the same (as shown in the above code). Can anyone help?