Jump to content
GreenSock

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

Smooth Scrolling (Not Anchor-Jumping!)

Recommended Posts

I've been playing around with ScrollTrigger - what an amazing tool!

 

I've managed to get horizontal scroll working in a variety of contexts, but still very much struggling with vertical momentum scroll for some reason. 

 

Here is a codesandbox that hews pretty close to Blake's codepen that was embedded on the first page of this thread (codesandbox because I'm working in React - hopefully it's a pared down enough example to be clear to read). 

 

 Ultimately my aim is to build a scrollTrigger + momentum version of this - I understand I'll have to remove the position stickies on each individual box and instead make use of pinning and pin spacing - I'll cross that bridge when it comes, though; till then, I'd just like to better understand how to get momentum scroll working like in Blakes codepen above, but in React, and roughly with the HTML in my codesandbox. I'd very much appreciate any help.

Edited by granularclouds
De-linked Blake's codepen because the link kept embedding instead of hyperlinking
Link to comment
Share on other sites

I'm not a React guy so I can't really help there, but I wonder if this might help you: 

 

Link to comment
Share on other sites

  • 1 month later...

I tried to use this method on my project where I've a pinned element, using GSAP.

The thing is it worked on every animations , except the element I've pinned. It plays the animation but also scrolls down without getting pinned and creates the extra black spacing until the animation is over.

Any Suggestions !!

Link to comment
Share on other sites

Welcome to the forums, @DexteRs Code

 

It's pretty tough to troubleshoot blind - can you please provide a minimal demo so we can see what's going on? 

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