Jump to content
Search Community

Observer issue with macbook trackpad

adamchampagne test
Moderator Tag

Recommended Posts

That's not an Observer issue - it's just that Apple touchpads and magic mouse keep emitting "wheel" events for a while after you release - it's what creates the momentum effect. So if you flick very strongly, you're firing the animation and then when the animation is done, there are still wheel events getting fired from the strong flick (momentum), thus it triggers another animation because those residual wheel events triggered the Observer's onUp()/onDown(). 

 

See the problem? 

 

So you could add some logic to sense that condition and work around it, like maybe: 

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

 

To make things easy, I just use ScrollTrigger's "scrollEnd" event handler but you could wire that all up yourself manually if you prefer not to use ScrollTrigger. 

 

Does that work better for you? 

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