Jump to content
GreenSock

momothemonster

Draggable ScrollTop overbounce

Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

First off - loving Draggable! Thanks so much.

 

I have an issue that may just be a misunderstanding of how things should work.

 

JSFiddle

 

In this example, if I'm scrolled most of the way to the top and I flick the draggable down, I'll scroll up and then rubber-band back down quite a ways. I'd like it to stop at the first element - ie forget the inertia once it hits the top so you can always flick your way all the way to the top.

 

Is the bounce-back displayed here the proper behavior? Am I applying resistances incorrectly?

Link to comment
Share on other sites

Hi and welcome to the GreenSock forums.

 

I think your snap function was causing the problem. 

Does this work better for you? http://jsfiddle.net/dMtAb/12/

  • Like 1
Link to comment
Share on other sites

Much better! That's totally on me and my use of the absolute value of the offset instead of the inverse. Thank you.

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