Jump to content

Pavel Stianko

Scrolltrigger on reload problem (Sveltekit)

Moderator Tag
Go to solution Solved by Pavel Stianko,

Recommended Posts

Hi @Bitworks and welcome to the GreenSock forums!


Maybe you could try ScrollTrigger.clearScrollMemory() method:



If you keep having issues, please provide a minimal demo. You can fork this starter template:



Hopefully this helps.

Happy Tweening!

Link to comment
Share on other sites

Thank you @Rodrigo! I will try the clearScrollMemory and also I will prepare the demo - but it seeems that it is doing this only after build (not in npm run dev). Also I found out that it is working good in gsap@3.11.1, but doing this problem in gsap@3.11.2 and newer.

Link to comment
Share on other sites

  • Solution

I tried to build and preview the minimal demo and the problem is the same (see the video). I had to slow down the loading using throttling so I can see it more often. So I added ScrollTrigger.clearScrollMemory(); to the top of the page and it is working fine! 🎉 So thank you for help @Rodrigo


// prevent scroll jump problem on reload
import { gsap } from 'gsap/dist/gsap';
import { ScrollTrigger } from 'gsap/dist/ScrollTrigger';
  • 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.