I’m trying to make my website mobile responsive, and in doing that, I’m making a hamburger/full-screen menu for smaller screens.
My issue is that since my website is only one page, all of my menu links are anchor links linking to another section on my website. When I click on one of the links, it doesn’t exit out of the full-screen menu. The user would have to manually click on the ‘x’ button to close out.
I’ve been different types of code to link my trigger to the hamburger menu but nothing seems to work. Help?
IE market share is so low, plus so many big sites stopped support - one must go out of one’s way to be still using it…
I see no reason why I should bother ;D
WF has already so many issues on IE, it will not run well anyway
But here you go (not tested)
let fullscreenLinks = document.querySelectorAll('a[toggle-menu]'), i
for (i = 0; i < fullscreenLinks.length; ++i) {
fullscreenLinks[i].addEventListener('click', () => {
document.getElementById('menu-toggle').click()
})
}