I’m using the following code to prevent scrolling once the menu is opened. It works but I’m having an issue where it breaks my in-page linking. Any ideas what the issue could be?
<script>
Webflow.push(function() {
$('.link').click(function(e) {
e.preventDefault();
$('body, html').css('overflow', 'hidden');
});
$('.link').click(function(e) {
e.preventDefault();
$('body').css('overflow', 'auto');
});
});
</script>
I’ve tried setting the second function target to ‘body, html’ as well and it work mostly the same.
(Code is in the project setting’s custom footer code section)