Jeanlat Posted February 5 Posted February 5 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.
Rodrigo Posted February 5 Posted February 5 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!
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now