On this page
What this issue is
On phones, your navigation usually sits behind a hamburger icon. Tapping it opens a full-screen or slide-in panel. This issue covers two related faults after the menu opens.
- The menu cannot be closed: the close icon does nothing, is hidden, sits off screen, or the menu stays open after you tap a link.
- The page scrolls behind the menu: you swipe inside the menu and the page underneath moves instead, or the menu itself will not scroll when it is taller than the screen.
Why it costs you leads or sales
- Landing pageVisitor arrives from an ad
- Opens menuTaps the hamburger icon
- Menu stuckClose does nothing or page scrolls behind
- Form or checkoutNever reached
The menu opens, but the visitor cannot get past it.
How to check if your site has it
Open your site on a real iPhone and Android phone
Use the browsers your visitors use: Safari on iOS and Chrome on Android. Narrow desktop windows often hide scroll and touch bugs.
Open the menu and try to close it
Tap the close icon, tap outside the panel, and tap a menu link. The menu should close and the right page or section should show.
Swipe inside the menu
The page behind should stay still. If the menu is long, the menu itself should scroll to its last item.
Rotate the phone
Landscape mode makes the menu shorter than its content, which exposes missing scrolling.
Check the console
In Chrome on desktop, open DevTools, switch on device mode, open the menu and look for red errors in the Console. A JavaScript error often stops the close handler from running.
How to fix it
| What you see | Likely cause | Fix |
|---|---|---|
| Close icon does nothing | JavaScript error or a plugin conflict | Fix the console error, disable conflicting plugins or scripts |
| Close icon not visible | Icon hidden behind the header or off screen | Check z-index and position of the close button |
| Menu stays open after tapping a link | One-page site or app-style navigation, no close on click | Close the menu in the link click handler |
| Page scrolls behind menu | No scroll lock on body | Add overflow hidden while the menu is open |
| Menu cannot scroll to last item | Menu taller than screen, fixed height | Give the panel max-height and overflow-y auto |
| Page stays locked after closing | Scroll lock class never removed | Remove it on close, link tap and page change |
body.menu-open {
overflow: hidden;
}
.mobile-menu {
position: fixed;
inset: 0;
height: 100dvh;
overflow-y: auto;
overscroll-behavior: contain;
z-index: 1000;
}const body = document.body;
const menu = document.querySelector('.mobile-menu');
const openBtn = document.querySelector('.menu-open-btn');
const closeBtn = document.querySelector('.menu-close-btn');
function openMenu() {
menu.hidden = false;
body.classList.add('menu-open');
}
function closeMenu() {
menu.hidden = true;
body.classList.remove('menu-open');
}
openBtn.addEventListener('click', openMenu);
closeBtn.addEventListener('click', closeMenu);
menu.addEventListener('click', (e) => {
if (e.target.closest('a')) closeMenu();
});
document.addEventListener('keydown', (e) => {
if (e.key === 'Escape') closeMenu();
});
window.addEventListener('pageshow', closeMenu);Find the conflict
Switch to a default theme such as Twenty Twenty-Four on a staging copy. If the menu works, the theme is the cause. If not, deactivate plugins one by one, especially menu, popup and optimization plugins.
Exclude menu scripts from optimization
If you use a caching or minify plugin, exclude the theme's menu script from JavaScript delay, defer or combine, then clear the cache.
Add the CSS fix
Add the scroll-lock CSS in Appearance > Customize > Additional CSS, using your theme's menu class names. Check what your theme adds to the body when the menu opens.
Test the theme
Preview your theme with apps disabled. In Online Store > Themes, duplicate the theme first so you can edit safely.
Check app embeds
In the theme editor, open App embeds and switch off apps that add popups or sticky bars one at a time to find overlay conflicts.
Edit the menu code
In the duplicated theme's code editor, find the header or drawer snippet and make sure closing removes the body lock class. Add the CSS from above to your theme stylesheet.
Look for injected scripts
Use Preview mode and check whether a Custom HTML tag adds a popup, chat widget or CSS that overlays the menu.
Pause the suspect tag
Pause it in a workspace, test the menu in Preview, then fix the tag's z-index or scroll handling before publishing.
Use the Navbar settings
Select the Navbar and check Menu Button, Nav Menu and Nav Links. Set the menu breakpoint you intend.
Close on link tap
For same-page anchor links, select the Navbar and enable the option that closes the menu on link click, or add a small script that does it.
Lock scrolling
Add a custom attribute or interaction that sets overflow hidden on the body while the menu is open, and clear it when it closes.
Check the header element
In the funnel or website builder, open the mobile view and test the menu element in preview.
Review custom code
Look at Custom CSS and Custom JS in page and site settings for rules that set position, height or overflow on the body or menu.
Edit the mobile menu
Open the Mobile editor and select the hamburger menu. Check the close icon is visible and the menu is not hidden behind other elements.
Remove overlapping elements
Check for strips, lightboxes or sticky elements layered above the menu. Wix has limited body control, so simplify the layout if scroll behind persists.
Test with Code Injection off
Temporarily remove custom entries under Settings > Advanced > Code Injection and retest.
Add targeted CSS
Add the scroll rules under Website > Custom CSS, matching the class your template uses for the mobile menu. These differ by template.
Use one open and close path
Route every close action (button, link, backdrop, Escape, route change) through one function that removes the lock.
Add the CSS and JS
Use the snippets above and adjust the selectors to your markup.
Broken
- Close icon unresponsive
- Page moves when you swipe the menu
- Last menu items cut off
- Body stays locked after navigating
Fixed
- Close works by icon, link, backdrop and Escape
- Page behind stays still
- Menu scrolls on its own
- Lock removed on every exit
No scroll lock
Leads or data lost
The visitor swipes inside the menu and the page underneath moves. They lose their place and may not find the close button.
Toggle to compare a menu without and with a body scroll lock.
How to confirm it's fixed
- Open and close the menu five times in a row on iPhone Safari and Android Chrome.
- Tap a menu link and confirm the menu closes and the page can scroll again.
- Swipe inside the open menu and confirm the page behind does not move.
- Rotate to landscape and confirm every menu item can be reached.
- Use the browser back button after opening a link and confirm the page is not stuck locked.
- Check the console shows no new errors.
How to prevent it happening again
- Test the mobile menu on a real phone after every theme, plugin or app update.
- Add a menu check to your release checklist for design and header changes.
- Test on a staging copy before publishing new popups, chat widgets or sticky bars.
- Keep one close function that always removes the scroll lock.
- Avoid delaying or combining the menu script in optimization settings.
How FunnelGuard handles this
Questions people ask
Why does my mobile menu not close?
Usually a JavaScript error, a plugin or app conflict, or a close button hidden behind another element. Open the browser console in device mode to look for errors, then disable plugins or apps one at a time to find the conflict.
How do I stop the page scrolling behind my mobile menu?
Add a class to the body when the menu opens and set overflow: hidden on it. Remove the class when the menu closes. Add overscroll-behavior: contain to the menu panel so swipes do not pass through to the page.
Why does the page stay locked after I close the menu?
The scroll lock class or inline style is not being removed on every exit path. Make sure closing by icon, link tap, backdrop tap and page navigation all call the same function that removes the lock.
Why does my mobile menu work on desktop but not on my phone?
Desktop narrow windows do not reproduce touch events, iOS Safari address bar behaviour or real viewport height. Test on a real device, and use 100dvh instead of 100vh so the menu fits the visible screen.
Why can't I scroll to the bottom of my mobile menu?
The menu panel is probably taller than the screen with no scrolling of its own. Give it a fixed position, a height of 100dvh and overflow-y: auto so long menus scroll inside the panel.
Does a broken mobile menu affect conversions?
Yes, if visitors rely on it to reach pricing, booking or checkout pages and cannot get past it. The impact depends on how much of your traffic is on mobile and how much of it uses the menu.
Does FunnelGuard check if my mobile menu can be closed?
No, not yet. It is a possible future check. FunnelGuard currently runs your customer journeys, tracking and lead delivery checks, so test the mobile menu manually on real phones after site changes.
Related issues
- PRF-168Hamburger menu does not openFix guide
- PRF-170Desktop-only hover menus unreachable on touchFix guide
- PRF-179Modal taller than mobile screen with unreachable close/submitFix guide
- PRF-157Sticky header takes over 25% of mobile screenFix guide
- PRF-156CTA covered by cookie banner or popupFix guide
- PRF-159Chat bubble covers the submit or checkout buttonFix guide