based on your answer to Keit that you donβt want to scroll, are active when you have a lightbox open? if so, you can add a class to the body at the same time as opening the lightbox with the following css
And the good thing about this solution is keeping the βspaceβ scroll, so the site doesnβt jump, it looks more like turning it off. hope this helps
body.noscroll { position: fixed; overflow-y: scroll; width: 100%; } $('body').addClass('noscroll'); $('body').removeClass('noscroll');
source share