Jump to content
GreenSock

Applauz

JS Drag, Throw, Boundary

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

Wondering how I could accomplish an effect in the JS version.

 

Basically want to make a horizontal line with a circle (handle). Think of it as the way a volume scrubber looks.

 

I want the ability to drag / throw it .. when it reaches the end of the line it will bounce and and start moving the opposite direction. 

 

I would also need a colored line to follow behind it. If that makes sense.

Link to comment
Share on other sites

As far as the dragging and trowing, yes, combining Draggable with ThrowPropsPlugin is perfect for that as illustrated here:http://greensock.com/draggable/

 

You would have to do some custom coding though to detect when the thrown object has hit the boundary and then create a new tween to give the illusion of a bounce.

 

Not quite sure all that you need to do with lines following each other, but I'm quite sure its possible. Probably not something GSAP handles out of the box though.

Link to comment
Share on other sites

  • 3 weeks later...

Yes: you can: just add onDrag() listener and read for "this.y" and you'll get the same position like iscroll5 :) 

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