Jump to content
Search Community

Minor errors in ScrollTrigger.normalizeScroll() documentation

Thibka test
Moderator Tag

Go to solution Solved by GreenSock,

Recommended Posts

In the documentation this example is displayed:

  allowNestedScroll: true, 
  lockAxis: false, 
  momentum: self => Math.min(3, self.velocityY / 1000); // dynamically control the duration of the momentum when flick-scrolling 
  type: "touch,wheel,pointer", // now the page will be drag-scrollable on desktop because "pointer" is in the list 

There are 2 errors in the momentum line:
- the line should end with a "," not a ";"
- it should return 

Math.min(3, Math.abs(self.velocityY) / 1000)

as velocityY is negative when scrolling down and the momentum value is expected to be positive.

That's it, 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...