Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
rubenmeines

Scrolltrigger pin: is a smoother stop possible?

Recommended Posts

Hi there,

 

I am working with scrolltrigger and I am pinning some full sized background images when they hit the bottom (see code). The only thing is that on mobile the stop is quite abrupt and sometimes has a bit of a back kick. So my question is if there is a possibility to smoothen this stop and if somebody has had this issue before as well?

 

gsap.to(scene, {
  scrollTrigger: {
    trigger: bgVisual,
    endTrigger: nextScene,
    start: "bottom 125%" ,
    end: "bottom -=5%",
    scrub: true,
    pin: true,
  },
});

Hope this is clear. 

Link to comment
Share on other sites

Hello there,

 

This code should work as expected.

Have you tried to add anticipatePin? It tends to handle what you are describing.

 

If this doesn't solve your issue. Make sure to make a demo, so that we can see it for ourselves in order to solve it.

 

image.png.b3082391ac2c4170f933d7422f910faf.png

 

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

  • Like 4
Link to comment
Share on other sites

1 hour ago, rubenmeines said:

The only thing is that on mobile the stop is quite abrupt and sometimes has a bit of a back kick. So my question is if there is a possibility to smoothen this stop and if somebody has had this issue before as well?

 

Hey @rubenmeines

 

The kick you are experiencing can be related to a variety of things, depending on how you have things set up.

Since what that 'kick' is, can also be interpreted in different ways, it would probably be best if you created a minimal demo of your issue.

 

Most likely it is related to how browsers handle the scrolling on a different thread and that makes it hard to sync things up.

If tailbreezy's suggestion with anticipatePin doesn't work for you, maybe these threads can be helpful

 

 

 

  • Like 4
Link to comment
Share on other sites

Thanks guys, the anticipate pin did improve some of it, but had some issues with browser resizing on mobile due to the browsers bars shrinking. In the end the client decided it did not like the effect at all so I'm moving on from it, until it comes on my path again.

 

Thanks for the great support. I'm gonna keep exploring Scrolltrigger!

Link to comment
Share on other sites

For what it's worth, you can work around mobile browsers resizing things when the nav bar toggles. For more info see these posts:

 

  • Like 2
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.

×