Jump to content
Search Community

GSAP Pin bug when refreshing the page

CROMA

Go to solution Solved by CROMA,

Recommended Posts

Posted

Hello everyone! 
We're building a website using GSAP with ScrollTrigger, ScrollTo and ScrollSmoother. We noticed that if you refresh the webpage after scrolling (so not when its on top) the pinned sections completely broke. Here's the website we're building: https://terramata.croma.site/it/

Looks like the page height is not calculated propely after a refresh.
Do you have any idea how to fix this? 
(Tested on CHROME)

Thanks!

Posted

Also, testing it on Safari 17.4.1 looks like it's totally broken on it. Do you have any idea why?

  • Solution
Posted

Solved! It was an error with the images, because of the native HTML5 lazy load, GSAP cannot calculate the website height unless you were starting navigating it from the top of the page.

  • Like 1
Posted

Glad you figured it out. By the way, I did create a little helper function that might be useful here: 

Enjoy!

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