Jump to content
GreenSock

microcipcip

SVG changing rotation speed on mouse hover

Moderator Tag
Go to solution Solved by OSUblake,

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

I am trying to animate a rotating SVG, but I have two issues:

  • on mouseEnter sometimes the animation "jumps"
  • when I try to mouseEnter/mouseLeave several times, the animation get slower/faster and sometimes it stops completely

I am not sure if this issue is due to the fact that I am not using a timeline, but I cannot use it easily because I have a complex animation. Is there a solution without using a timeline?

See the Pen YqbBqZ by microcipcip (@microcipcip) on CodePen

Link to comment
Share on other sites

  • Solution

You're telling it to go to 360 degrees when it should be to add 360 degrees.

directionalRotation: "+=360_cw"
  • 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.
×