Jump to content
Search Community

Snapping Cursor to Button Size

maoux test
Moderator Tag

Recommended Posts

What have you tried already? We love to see what you can come up with, that way we can see your thought process and thus better help you understand the tools!

 

I would add another addEventListener to use button to check if the mouse is entering or leaving and then you could use something like https://gsap.com/docs/v3/Plugins/MotionPathPlugin/static.getRelativePosition()/ to move the element from it current position to the center one. 

 

Also check out the quickSetter() in GSAP, a much more performant  way of having things animate on mouse move. https://gsap.com/docs/v3/GSAP/gsap.quickSetter()/

 

Hope it helps and happy tweening! 

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