D.Cus Posted September 3, 2021 Share Posted September 3, 2021 How do I update the end value in this scrollTrigger when the browser does a resize. I have tried doing a resize event to fire ScrollTrigger.refresh(); but this seems to do nothing and running the scrollTrigger within a resize just creates multiple scrollTrigger instances Thanks in advance See the Pen JjJKmbM?editors=1111 by darren-ignition (@darren-ignition) on CodePen Link to comment Share on other sites More sharing options...
Solution Cassie Posted September 3, 2021 Solution Share Posted September 3, 2021 Hey there! If you're trying to set the end trigger at the top of the footer element you can set the footer as the end trigger. See the Pen rNwLQOK?editors=1011 by GreenSock (@GreenSock) on CodePen You can also use the invalidateOnRefresh property. It will refresh any functional values. invalidateOnRefresh Boolean - If true, the animation associated with the ScrollTrigger will have its invalidate() method called whenever a refresh() occurs (typically on resize). This flushes out any internally-recorded starting values. See the Pen MWoezpG by GreenSock (@GreenSock) on CodePen 5 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