Jump to content
Search Community

Rotation is reversed on completing full cycle, Clicking during transition restarts the animation

yeeloong001 test
Moderator Tag

Go to solution Solved by GreenSock,

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

So I have 2 problems here,

 

1. For some reason, the rotation seems to reverse its direction for one of the increment upon completing a full circle. Currently I intend to have the circular blob move through every 30 angles on clicking the button.

 

2. When I click the button again during the transition, it resets the transition instead of chaining it. I was trying to find ways in which I can chain the animation so that it doesn't reset but allow the user to continue onto the next item.

 

Thanks for any help in advance.

See the Pen RNJWbG by anon (@anon) on CodePen

Link to comment
Share on other sites

  • Solution

1) You were resetting the angle once it got to 390. So when you go from 390 back to 30, it'd go the other way. You can use a directional suffix if you want, like "30_cw" to go clockwise, or "30_ccw" for counter-clockwise.

 

2) Yep, you were restarting the tween which is why it went back like that. 

 

I think you meant to do something like this which would be simpler and more efficient: http://codepen.io/anon/pen/VYdvej?editors=001

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