Wixxtorr Posted August 10, 2022 Share Posted August 10, 2022 Hi! I'm trying to understand how a scroll trigger works. In this example, I can’t manage to set up a scroll trigger in such a way that the scrolling of images ends at the right edge of the window, and does not scroll all the way to the left. Can anyone suggest? I've already tried different options, it doesn't work. Viktor See the Pen oNqMovG by v777999 (@v777999) on CodePen Link to comment Share on other sites More sharing options...
GreenSock Posted August 10, 2022 Share Posted August 10, 2022 Like this?: See the Pen MWVBOzp?editors=1010 by GreenSock (@GreenSock) on CodePen You just needed to adjust the x distance (subtracting the window.innerWidth). And I'd recommend making it a function-based value and setting invalidateOnRefresh: true on your ScrollTrigger so that it's forced to re-calculate that whenever the window resizes (responsive). Happy tweening! 1 Link to comment Share on other sites More sharing options...
Solution Wixxtorr Posted August 10, 2022 Author Solution Share Posted August 10, 2022 57 minutes ago, GreenSock said: Like this?: You just needed to adjust the x distance (subtracting the window.innerWidth). And I'd recommend making it a function-based value and setting invalidateOnRefresh: true on your ScrollTrigger so that it's forced to re-calculate that whenever the window resizes (responsive). Happy tweening! Yes, that's exactly what I wanted! Thank you so much! I will continue to study further. 1 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