Jump to content


A final clarification about invalidate() and responsive timelines

Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

Hey Tom! Just to be clear about why your original solution wasn't working - your calculations with getBoundingClientRect() were assuming that the elements where all in their original positions, but if you refresh when you're further down (part-way into the animation), that wouldn't be the case AFTER the refresh. Those values would be different. So Carl's/Rodrigo's solutions work because it's happening at the proper time when those things are temporarily reverted (part of ScrollTrigger's refresh() involves rolling everything back to the original state with no pinning, going back to a scroll position of 0, etc. just so that everything gets calculated properly, top-down). 

  • Like 3
Link to comment
Share on other sites

Makes sense and great to know, Jack! I appreciate all of the insights and help on this. Learned multiple new things here :)

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