Jump to content
Search Community

GSAP Set active image and pin sidebar based on scroll

Adesh test
Moderator Tag

Go to solution Solved by akapowl,

Recommended Posts

I was attempting to create some animation, such as an active image based on right side scroll, but everything is working properly except the Pin sidebar does not end at the bottom of the section.

 

Could you please look into this and let me know what I'm doing wrong and what the solution is?

See the Pen qByrRKz by Adesh-Evince (@Adesh-Evince) on CodePen

Link to comment
Share on other sites

  • Solution

 

You can set an endTrigger element, as described in the ScrollTrigger documentation, @Adesh - e.g. the container wrapping your text-elements on the right side.

 

Then you'll need to set the end according to that element, which will likely be 'bottom bottom' in the case mentioned above, so when the bottom of that element hits the bottom of the window - btw right now you do not have an end set at all, only the start twice, so that might be something you'd want to change.

 

endTrigger String | Element - The element (or selector text for the element) whose position in the normal document flow is used for calculating where the ScrollTrigger ends. You don't need to define an endTrigger unless it's DIFFERENT than the trigger element because that's the default.
  • 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.
×
×
  • Create New...