Sukru Posted August 17, 2022 Share Posted August 17, 2022 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 More sharing options...
Cassie Posted August 17, 2022 Share Posted August 17, 2022 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 1 Link to comment Share on other sites More sharing options...
Sukru Posted August 19, 2022 Author Share Posted August 19, 2022 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now