Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
apostopher

ScrollTrigger with scrollTo

Go to solution Solved by Cassie,

Recommended Posts

I'm trying to use scrollTrigger along with navigation links. when i load the page and click the navigation link (e.g panel 4) it correctly animates to panel 4. However if i click another link after that (e.g Panel 3) the scrollTrigger does not scroll correctly. when i click `panel 1` it animates to `panel 2`.

 

I think i have configured the scroll trigger incorrectly. can someone pls help me?

See the Pen jOLPzQG by apostopher (@apostopher) on CodePen

Link to comment
Share on other sites

  • Solution

Hi Apostopher

Because of the layered pinning the calculated height of the target link is a bit off.

If you do a calculation instead it works!

Thanks for being part of club GreenSock 🥳

See the Pen ExvjLrj?editors=1011 by GreenSock (@GreenSock) on CodePen

  • Like 1
Link to comment
Share on other sites

18 minutes ago, Cassie said:

Hi Apostopher

Because of the layered pinning the calculated height of the target link is a bit off.

If you do a calculation instead it work!

Thanks for being part of club GreenSock 🥳
 

 

 

Thanks a lot @Cassie 

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