Jump to content
Search Community

timelineMax js Rotation problem

thepark001 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

This is an overwrite an issue. Your values are getting out of sync when you interrupt an animation. You need to keep track of your animation's state somehow. For a simple rotational animation that isn't too hard. You could store the values on the element's data property like this example.

See the Pen QNpxEo?editors=0010 by osublake (@osublake) on CodePen

 

I'm not familiar with Chart.js, and what you have looks fairly complex, so it might be better to not animate your objects directly. You could use another object/class, as a proxy for your animation.

 

I made something other day that does that. I use the change in position of a hidden div that can be dragged/thrown as the value to update the frame number on a sprite animation. I turned on some borders so you can see the hidden stuff.

See the Pen ?editors=0010 by osublake (@osublake) on CodePen

 

That's using Draggable, which of course you don't need. The point is to show how you can use something else to animate other stuff. I modified your example to use a RadarAnimation class I quickly put together. Now you can click as fast as you want.

See the Pen ?editors=0010 by osublake (@osublake) on CodePen

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