Jump to content
Search Community

Scrolltrigger on reload problem (Sveltekit)

Pavel Stianko test
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:

https://greensock.com/docs/v3/Plugins/ScrollTrigger/static.clearScrollMemory()

 

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

https://stackblitz.com/edit/sveltejs-kit-template-default-unljf6

 

Hopefully this helps.

Happy Tweening!

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';
ScrollTrigger.clearScrollMemory();
  • 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.
×
×
  • Create New...