Why is my mobile menu not functioning correctly? The submenu should open on the first click and redirect to the parent URL on the second click, which works fine. However, when the window width increases to 768px or more, the submenu should appear on hover over the parent but the parent tag doesn't redirect properly on the first click.
I need assistance in reorganizing the window.addEventListener('resize', function(){ ... }); as the addEventListener and removeEventListener functions are not working as expected.
Why does the event triggering the prevFirstClick (mobile version) function remain even after enlarging the screen to 768 px?
And why isn't the event triggering the prevFirstClick (desktop version) function added back when the screen size is reduced below 768 px?
I've tried numerous combinations without success. Any guidance would be greatly appreciated!