Check out the example below. when the makeshift mobile menu is open, the user is unable to scroll through background content. Upon closing the menu, the user is able to scroll again. This code could be applied to any use case where you want to enabled and disable page scrolling using a single element as a toggle.
Copy the code below to the before </body> tag of the page you need the functionality on. If you want this functionality site wide, paste this code in the before </body> tag of your custom code in site settings.