Jeanlat Posted September 8, 2020 Share Posted September 8, 2020 Hello ! I use this resource and it works pretty good but the hover animation freezes on scroll. Any Idea to solve this ? See the Pen GRZQqOO by Jeanlat (@Jeanlat) on CodePen Link to comment Share on other sites More sharing options...
ZachSaucier Posted September 8, 2020 Share Posted September 8, 2020 Hey Jeanlat and welcome to the GreenSock forums. Mouse events are purposefully suppressed by most browsers when the user is scrolling. Otherwise you'd have a lot of events firing for elements that usually aren't meant to be hovered. I would likely reverse the animation on scroll. Link to comment Share on other sites More sharing options...
Jeanlat Posted September 8, 2020 Author Share Posted September 8, 2020 Thank you for your answer ! I understand, isn't it possible to force specific mouse event ? Link to comment Share on other sites More sharing options...
ZachSaucier Posted September 8, 2020 Share Posted September 8, 2020 I seem to remember another thread that asked that question but I can't seem to find it right now. Maybe someone else can step in and link to it. IIRC, it's possible but not the most performant to do so (you'd have to calculate elementsFromPoint for each tick of the scroll and manually fire any event listeners for those elements). As I said before I recommend just reversing the animation on scroll. Link to comment Share on other sites More sharing options...
Jeanlat Posted September 8, 2020 Author Share Posted September 8, 2020 Ok, thanks a lot ! Link to comment Share on other sites More sharing options...
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