Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
sirhclluk

Draggable controlling timeline

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?

 

Thanks

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:

 

http://greensock.com/forums/topic/11161-control-timeline-through-rotation-draggable/

 

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

 

Happy tweening.

:)

  • Like 2
Link to comment
Share on other sites

If you have the whole sequence as a timeline, you can do something like this:  

 

See the Pen vOYrGe by rfenik (@rfenik) on CodePen

Link to comment
Share on other sites

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