Jump to content
GreenSock

Sukru

Scrollsmoother Paused

Recommended Posts

Hello, I am running modal box and menu in codepen. However, the scroll moves during this process, how can it be made active and passive?
Can you do it on Codepen example, I tried a few times but I couldn't. Thank you in advance.

See the Pen VwXENRN by sukruemanet (@sukruemanet) on CodePen

Link to comment
Share on other sites

Heya!

 

I'm sure I remember answering this one. smoother.paused() is what you're after. You just call it and pass in a boolean.

See the Pen xxWmqKE?editors=0010 by GreenSock (@GreenSock) on CodePen

  • Like 1
Link to comment
Share on other sites

On 8/18/2022 at 12:49 AM, Cassie said:

Heya!

 

I'm sure I remember answering this one. smoother.paused() is what you're after. You just call it and pass in a boolean.
 

 

@Cassie Hello again, so can we use it like toggleClass here?

 

$(function () {
$(".mobile-menu").click(function (event) {
event.stopPropagation();
$("#hamburger-menu").toggleClass("open");
$('.menu-content').toggleClass("open");
$('.mobile-menu-content').toggleClass('visible');
smoother.paused(true);
});
 
$(".mobile-menu").click(function (event) {
smoother.paused(false);
});
});
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×