Jump to content
Search Community

Drag svg along the path

DD77 test
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

Hello, 
I trying to have a smooth dragging animation which almost works. 
The only missing parts that I'm struggling with are:

 

 - I'd like to have the knob following the path along the line.

- second id like to have a onComplete function once the knob are at the end of the line.

- also anyway I can make the knob draggable in a better way? is difficult to "grab it with the mouse".


Any help is much appreciated.


 

, onComplete:function(){
                console.log('do the magic');  
}

See the Pen daGbgP by davide77 (@davide77) on CodePen

Link to comment
Share on other sites

Please see this post and the demos from @OSUblake

 

as for knowing when the drag is at the end, you could probably run some code to check if the current x and y of the object are within a specified range of the end coordinates.

 

Very little of this functionality is built into GSAP and as you will see the custom logic and calculations are all very complex. Not something we can really provide support for. Good luck with your project!

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