Jump to content
GreenSock

abbdab

Resetting ScrollTrigger in Vue page change

Recommended Posts

GSAP newbie here!

 

Using ScrollTrigger with Vue to create parallax and pinned background but the scrolls bug out on page changes.  When returning to a page, the page automatically scrolls down to the bottom of the page.  I read the documentation and it is because SPAs do not destroy ScrollTriggers on page change. I tried implementing .kill() & refresh() in unmounted hook however it didn't help much. I tried to setup a Codepen but it is a big project and I couldn't figure out a way to create a minimal example.  

Link to comment
Share on other sites

First, I'd recommend making sure you're using the latest version (3.7.1 at this point). 

 

If that doesn't resolve things, we really do need to see a minimal demo in order to help. Strip out everything that's not essential. even if the page has one <div> only, that's fine. Just the simplest thing possible that shows the issue occurring. Once we see it in context, we'll be able to offer some advice. 

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