locomotivemtl / locomotive-scroll

🛤 Detection of elements in viewport & smooth scrolling with parallax.
https://locomotivemtl.github.io/locomotive-scroll
MIT License
7.84k stars 1.12k forks source link

How to stop scrolling with an overlay modal ? #510

Open HenriHarvest opened 1 year ago

HenriHarvest commented 1 year ago

Hi, I started using locomotive and made an overlay menu. Normally I should have use an overflow hidden. But here it's not working

.scroll-stop
{
    overflow: hidden !important;
}
$('#toggle').click(function() {
    $(this).toggleClass('active');
    $('#overlay').toggleClass('open');
    $('body').toggleClass('scroll-stop');
});