Jump to content
Search Community

The animation lagging when scroll hard and mobile device [ScrollToPlugin & ScrollTrigger]

Krix test
Moderator Tag

Go to solution Solved by Rodrigo,

Recommended Posts

My case is when the user scrolls the first time, no matter whether short or long, the animation must be finished. And revert the animation when going backward.

But somehow when I scroll hard, the heading is lagging.

You can test it on a mobile device and see the difference.

 

video: https://drive.google.com/file/d/17V6gMXfMVGqWCzZppKC5TwgKmZBSbC_g/view?usp=drivesdk

 

Codesanbox link: https://codesandbox.io/p/sandbox/charming-hill-ss2m8s

 

 

Link to comment
Share on other sites

  • Solution

Hi,

 

This seems more related to the way touch devices handle scroll.

 

Try using normalizeScroll and see how it goes:

https://greensock.com/docs/v3/Plugins/ScrollTrigger/static.normalizeScroll()

 

gsap.registerPlugin(ScrollTrigger, ScrollToPlugin);

ScrollTrigger.normalizeScroll(true);

Also you could try a more specific snap configuration in your ScrollTrigger instance (scroll down until the snap section and see the object configuration). Basically you want to snap to an array of values [0, 1] so it goes to the start or end point of the ScrollTrigger instance:

https://greensock.com/docs/v3/Plugins/ScrollTrigger

 

Hopefully this helps.

Happy Tweening!

Link to comment
Share on other sites

6 hours ago, Rodrigo said:

Hi,

 

This seems more related to the way touch devices handle scroll.

 

Try using normalizeScroll and see how it goes:

https://greensock.com/docs/v3/Plugins/ScrollTrigger/static.normalizeScroll()

 

gsap.registerPlugin(ScrollTrigger, ScrollToPlugin);

ScrollTrigger.normalizeScroll(true);

Also you could try a more specific snap configuration in your ScrollTrigger instance (scroll down until the snap section and see the object configuration). Basically you want to snap to an array of values [0, 1] so it goes to the start or end point of the ScrollTrigger instance:

https://greensock.com/docs/v3/Plugins/ScrollTrigger

 

Hopefully this helps.

Happy Tweening!

Thanks for your response, I tried the snap with values [0,1] but it has a delay time (even though I set the delay time as 0) and it does not scroll immediately.

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...