Jump to content
Search Community

Hover animation need to rotate slightly with mouse move

Pathirana test
Moderator Tag

Go to solution Solved by Rodrigo,

Recommended Posts

  • Solution

Hi @Pathirana and welcome to the GreenSock forums!


What you can do is check the mouse position in the X axis and create a GSAP animation for each image that rotates the image from a starting angle to an end angle. Then you can control that animation's progress using the mouse position value.


Here is a simple example illustrating that:

See the Pen jOKLNLG by GreenSock (@GreenSock) on CodePen


Hopefully this is enough to get you started. Let us know if you have more questions.


Happy Tweening!

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