Skip to content

How to Disable Scrolling When Menu is Active #574

@Nafiz-Ahmed

Description

@Nafiz-Ahmed

Hello!

I'm working with Locomotive Scroll beta for my project of next js, and I need to disable the page scroll when the navigation menu is on. However, I have faced limitations while implementing these. I have tried different ways of going about this, such as manipulating the overflow of the body or trying to manage the scroll behaviors of Locomotive Scroll. However, none of them have helped me out.

The main issue is, when the menu is opened, I would like to have native scrolling and the custom scroll behavior of Locomotive Scroll disabled; when the menu is closed, I would like scrolling to be enabled again and Locomotive Scroll to start its smooth scrolling.

I've tried using stop() and start() methods on Locomotive Scroll to control this, but I still can't get the behavior I want.

Is there something I missed? Which method should I be using or configuring in order to control the scrolling better with Locomotive Scroll when the menu is open?

I appreciate any suggestions!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions