LSchneiderman Posted June 7 Share Posted June 7 I'm trying to get an image to stayed pinned until another image has scrolled to the top. I'm not sure how to do this. I do have a variable called "height": var height = $(window).height(); Can I do a pin like this? ScrollTrigger.create({ trigger: "#sprawl", start: "top top", pin: true, end: "+=" + height * 2 }); Or is there a way to end a pin with relation to another element? Link to comment Share on other sites More sharing options...
Solution Carl Posted June 7 Solution Share Posted June 7 Hi, you can specify an endTrigger https://gsap.com/docs/v3/Plugins/ScrollTrigger/?page=1#endTrigger here is a quick example: See the Pen jOoLqNx?editors=0110 by snorkltv (@snorkltv) on CodePen if you need something different please provide a minimal demo 2 Link to comment Share on other sites More sharing options...
Rodrigo Posted June 7 Share Posted June 7 Hi, I think this is related with this other thread you created? If so please let's focus our attention in just one of these threads so it's easier to track for everyone involved. Happy Tweening! 1 Link to comment Share on other sites More sharing options...
LSchneiderman Posted June 11 Author Share Posted June 11 Yes, thanks, @Rodrigo. 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