Jump to content
Search Community

Smooth movement cursor image on hover element

Lounes_514 test
Moderator Tag

Go to solution Solved by noviedo,

Recommended Posts

 

Hello, I discovered this nice solution that I want to use in my portfolio. To give you some context, I use Webflow and custom code often. I'm learning javascript and I am new to gsap. Basically, I just wanted to add some smoothing to the cursor movement and delay to the image relative to the cursor. In the code, how can I add some smoothness and duration? 

 

Your help is very appreciated. 

 

Thank you,

See the Pen abWeQJa by pixelarchitect (@pixelarchitect) on CodePen

Link to comment
Share on other sites

If you find yourself calling gsap.set() many times on the same object (or set of objects), like in a "mousemove" event, you can boost performance 50% - 250% by creating a quickSetter function and using that instead of gsap.set().
 

And on the other hand, If you find yourself calling gsap.to() many times on the same numeric property of the same target, like in a "mousemove" event, you can boost performance by creating a quickTo() function instead.
 

Basically a gsap.quickSetter() is a optimized function of gsap.set() and gsap.quickTo() is a optimized function of gsap.to()

 

I leave here both links to the documentation. (gsap.quickTo() & gsap.quickSetter())

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