I have a mobile menu, more than the height of the screen. I want to disable the page scrolling, but allow scrolling in the menu, usually the menu height is larger than the window.
$('.menumob').click(function () { $('#mobile-menu').fadeIn(400).css({ display: 'flex' }); $("body").css("overflow","hidden"); }); //Close mobile menu $('.menumob_close').click(function () { $('#mobile-menu').fadeOut(400); $("body").css("overflow","auto"); }); This code disables the scroll, but also disables the menu. Added overflow:auto and overflow:scroll did not help.