Jump to content
Search Community

Call this.$ScrollTrigger.refresh() error when redirect page with Nuxt

Kency test
Moderator Tag

Recommended Posts

Hello!

 

First of all, thank you so much with GSAP !

 

I use nuxt-gsap-module when I redirect between 2 page by nuxt-link, seem scroll height not refresh, it use scroll height of page previous. I use this.$ScrollTrigger.refresh() but it error.

 

I use CodePen Home ScrollTrigger - Horizontal Scroll

Thank all

Capture.PNG

See the Pen GRZORvX by olig (@olig) on CodePen

Link to comment
Share on other sites

Hey there!

 

Nuxt gsap module isn't actually ours. It's a third party solution.

'Cannot read properties of Null' sounds like you're trying to target something that doesn't exist.

 

Hard to advise beyond this I'm afraid.
 

  • Like 1
Link to comment
Share on other sites

I resolved problem scrollHeight when use 

beforeDestroy() {
        this.tl.scrollTrigger.kill();
    },

and add <div> parent 

instead of use this.$ScrollTrigger.refresh() in mounted()

Thanks

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