Jump to content
Search Community

Between two scenes, snap to the nearest scene

Kency test
Moderator Tag

Go to solution Solved by GreenSock,

Recommended Posts

  • Solution

That's because you set up your "snap" to be a specific number, 0.33333 which means it'll snap to the nearest 1/3rd progress. However, you're using very different widths for your sections, so they wouldn't be in equal increments like that. 

 

This may help: 

See the Pen xxEQNBB by GreenSock (@GreenSock) on CodePen

 

This helper function may also be useful: 

https://greensock.com/docs/v3/HelperFunctions#getScrollLookup

 

Does that clear things up? 

  • Like 2
Link to comment
Share on other sites

29 minutes ago, GreenSock said:

That's because you set up your "snap" to be a specific number, 0.33333 which means it'll snap to the nearest 1/3rd progress. However, you're using very different widths for your sections, so they wouldn't be in equal increments like that. 

 

This may help: 

 

 

 

This helper function may also be useful: 

https://greensock.com/docs/v3/HelperFunctions#getScrollLookup

 

Does that clear things up? 

Yep, Thank you very much.

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