I created a menu that is hidden and appears when you click on the hamburger icon. At the same time, this click triggers the animation on the hamburger, turning it into an X. Clicking the hamburger again hides the menu and animates the hamburger back to its original state. Everything works as it should here.
The problem occurs when clicking on navlink. The page scrolls to the correct section. I set up exactly the same animation as when I click on the hamburger icon (X) again and the menu hides correctly, but the hamburger does not return to its original state.
Does anyone have an idea how to do this to keep the animations on the hamburger icon, but at the same time be able to trigger it correctly by clicking on the navlink?
I’m working on the site all the time, so there may be changes to this menu in the process, but so far I haven’t been able to fix the problem. I will be grateful for your help.