Jump to content
Search Community

Disable ScrollSmoother on Mobile?

neontrenton test
Moderator Tag

Recommended Posts

Hello,

 

I'm using ScrollSmoother and it's working great, except for one small issue. With my mobile menu, I cannot "scroll" through it vertically when it's opened. This has something to do with ScrollSmoother. Is there an easy fix for this, or some way that I can disable ScrollSmoother on mobile so my menu works properly? Here's a link to my dev site.

scroll-issue.jpg

Link to comment
Share on other sites

  • 9 months later...

The issue I am having is that I am unable to pull down to refresh on mobiles while ScrollSmoother is enabled. I have found the following JS which does stop most of the ScrollSmoother:


window.onload = () => {
if (window.matchMedia('(max-width: 480px)').matches) {
window._mp_smoother.kill();
window.ScrollTrigger.killAll();
} else {}
}


However, I am still unable to refresh on mobile by pull-down.

 

Since I am using Motion.page, I am having to use JS externally.

Link to comment
Share on other sites

Hi,

 

I'd echo what Cassie is suggesting to pause the ScrollSmoother instance.

 

But if you need to just match a specific break point on the width, you should really take a look at GSAP MatchMedia, since it'll revert everything once you ass the provided breakpoint:

https://greensock.com/docs/v3/GSAP/gsap.matchMedia()

 

If possible please create a minimal demo that illustrates your scenario in the simplest possible way. You can fork this codepen that has ScrollSmoother and every other GSAP Plugin in it:

See the Pen aYYOdN by GreenSock (@GreenSock) on CodePen

 

Happy  Tweening!

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.
×
×
  • Create New...