Jump to content


Draggable controlling timeline

Go to solution Solved by sirhclluk,

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

Is this possible with Draggable?

In a banner I want to drag a road jpg horizontally, and have a car move along the road as I drag the road jpg.

So the car stays in the same spot horizontally, just moving up and down and turning as needed.


if it is possible could someone share a link related to it?



Link to comment
Share on other sites

Hi sirhclluk :)


You just need an onDrag callback to control the progress of the timeline. I didn't have time to make a CodePen for you, but please check out this thread:




Rodrigo has a nice CodePen in his answer. That should get you started.


Happy tweening.


  • Like 2
Link to comment
Share on other sites

  • Solution

Thank you both for the replies. PointC, I got it to work based on that example.

I had to change the bound to numbers and not just the name of the object. And on the progress line had to change it to t.progress( this.x/-484 );


Thank You GSAP!

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