Jump to content
Search Community

ScrollTrigger not snapping when scrolling

Guest
Moderator Tag

Go to solution Solved by mvaneijgen,

Recommended Posts

For some reason this codepen from the docs: 

See the Pen KKpLdWW?editors=0010 by GreenSock (@GreenSock) on CodePen

 does not seem to work in my case as when it's suppsoed to snap the next element, it 

I stripped it as much as possible and the issue persists as you can see in the codepen, the only issue I can think of is css but what am I doing wrong here?

See the Pen vYRVvpb by nicvh (@nicvh) on CodePen

Link to comment
Share on other sites

Thank you @mvaneijgen that works.

 

Why do I have to create 2 ScrollTrigger per article to make this work?

My issue here is that I need the pinned element onComplete but onSnapComplete gets fired only in the second ScrollTrigger and onComplete gets fired on the second ScrollTrigger but I don't have access to the pinned element.

 

I tried to merge the 2 but snapping doesn't snap properly to the top of the next element, just finish the scrolling for some reason.

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