How to prevent body from scrolling when modal window open

Hi, it should work in published site, can you check and clarify?

Edit: also, published site, previewed in mobile browser, not desktop browser.

Edit 2: I just checked on my own site, solution seemed to not work as it previously did. My suspicion is that there was some fix on iOS 13. I changed overflowY: ‘scroll’, to overflow: ‘scroll’, and
overflowY: ‘hidden’ to overflow: ‘hidden’, seemed to fix the problem and eliminated scroll together with page jumping. Let me know if that works for you @Philemon

<script>
Webflow.push(function() {
  $('.menu-button-class').click(function(e) {
    e.preventDefault();

    var clicks = $(this).data('clicks');
        
    if (clicks) {
      $('body').css({
        overflow: 'scroll',
        '-webkit-overflow-scrolling': 'touch',
        position: 'inherit',
        top: '0'
      });

      $(window).scrollTop($(this).data('offset'));
    } else {
      $(this).data('offset', window.pageYOffset);
      
      $('body').css({
        overflow: 'hidden',
        height: 'auto',
        position: 'absolute',
        top: 0 - window.pageYOffset
      });      
    }

    $(this).data("clicks", !clicks);
  });
});
</script>