Jump to content
GreenSock

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

spinner not spinning!

Go to solution Solved by PointC,

Recommended Posts

I forked the 'draggable knob...' pen to show you my problem

I can get my knob to spin but only on a corner!

I need it to spin on its center axis

:-)

 

See the Pen OJbeGvQ by bennysutton (@bennysutton) on CodePen

Link to post
Share on other sites

You'd need to set the transformOrigin to center. You'll also want to use the GSAP 3 scripts instead of 2 and load inertia.

 

Here's a fork with those changes. 

See the Pen 34e476b8db5cf305361230fb377e67fc by PointC (@PointC) on CodePen

 

Happy tweening.

:)

 

  • Like 5
Link to post
Share on other sites

cool!

is there any way I can get values to control another animation?

Link to post
Share on other sites

Sure. You can map the rotation to any other animation or value you like. I actually have an entire tutorial about mapping dials to change HSLA color values. 

https://www.motiontricks.com/hsla-color-dials-with-maprange/

 

There are multiple demos in the tutorial, but this is the final result.

See the Pen ExKRrEX by PointC (@PointC) on CodePen

 

Happy tweening.

:)

 

  • Like 3
  • Thanks 1
Link to post
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.

×