Need help implementing Body Scroll Lock with owl-c

2019-08-19 05:44发布

问题:

I'm trying to disable scrolling across all mobile devices (especially iOS) when images are swiped left/right in owl-carousel.

I've found Body Scroll Lock to be one of the only methods that works on iOS. https://bodyscrolllock.now.sh

I just need help writing code that can activate it when the owl-carousel event touchDrag is called.

I've tried a few methods suggested for similar questions with no results.

I should mention that I don't know javascript at all...

Thanks for any help!

This is the only javascript code I have at the moment:

$(document).ready(function() {
        $("#project1, #project2, #project3, #project4, #project5, #project6, #project7, #project8").owlCarousel({
            items: 1,
            navSpeed: 600,
            dotsSpeed: 300,
            nav: true,
            loop: true,
            lazyLoad: true,
        });
    });