Jump to content
Search Community

GSAP ScrollSmoother: My Custom Cursor Does Not Trigger on Scroll

Jeanlat
Moderator Tag

Recommended Posts

Posted

Hi everyone,

I can't get my custom cursor to trigger when the target is hovered over during scrolling. Could you show me how to achieve this based on the following example?

Thank you!


See the Pen GRYLMzX by GreenSock (@GreenSock) on CodePen.

Posted

Hi,

 

That has nothing to do with ScrollSmoother and/or GSAP, the mouseenter/leave events are triggered based on the movement of the mouse pointer not the positions of the elements with the event handlers attached to them and the mouse pointer in the screen. If you remove ScrollSmoother from your demo you'll see that the behaviour is the same.

 

A possible workaround is to set the mouse pointer position in the screen and while scrolling check if the mouse position matches or intersects the element and based on that trigger the same function.

 

Hopefully this clear things up

Happy Tweening!

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