Jump to content
Search Community

Animate frames with Draggable

scavaliere test
Moderator Tag

Go to solution Solved by mvaneijgen,

Recommended Posts

  • Solution

You've disabled the forking of your pens. Makes it really hard to copy your work and apply fixes for it, I had to manually copy over all the code to a new pen. Just FYI.

 

You have the variable control, but as far as I see you never update its value, it is always zero.

 

Personally when in doubt I use a timeline, so I've converted your tween to a timeline. This gets you more options and is overall more flexible. 

 

My thought process was, I want to map the x axis movement to a value between 0 and 1 (because a timeline has a progress from 0 to 1), so I've used the amazing GSAP util function    gsap.utils.mapRange() (I love these util functions! https://greensock.com/docs/v3/GSAP/UtilityMethods/mapRange()) for that and just feed the current x location to that function, then I update the .progress() of the timeline with that. 

 

See the Pen rNKmVoB by mvaneijgen (@mvaneijgen) on CodePen

 

Hope it helps and happy tweening! 

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