khudiiash Posted January 18, 2021 Share Posted January 18, 2021 Hey, first time here. Love GSAP, but found an issue, not sure how to solve. In the Codepen, I recreated the problem: 1. We have a timeline that gradually autoscrolls the element. 2. We want to stop the timeline when user starts scrolling himself. 3. When the user scrolls, tweens seem to be autoKilling, but then the timeline continues to play. Therefore, we need to stop the timeline. 4. For this purpose, we want to use onAutoKill callback (seen in the docs). However, it does not fire at all. In my actual project, i detected when the user is scrolling and tried to stop the timeline this way, but even after killing/pausing the timeline or all its tweens, the timeline continued to play each tween until the end. See the Pen oNzmpMw?editors=1111 by khudiiash-the-bold (@khudiiash-the-bold) on CodePen 1 Link to comment Share on other sites More sharing options...
ZachSaucier Posted January 18, 2021 Share Posted January 18, 2021 Hey khudiiash and welcome to the GreenSock forums. Thanks a lot for posting and for the clear demo. This looks like a bug that was introduced between GSAP versions 3.5.0 and 3.5.1. We'll get that fixed ASAP and get back to you A few side notes: autoKill: true is the default for scrollTo tweens so you can leave that out. You'd probably greatly benefit from my article about animating efficiently which covers using relative values, defaults, and other tips to help you write animation code more efficiently. 1 Link to comment Share on other sites More sharing options...
Solution GreenSock Posted January 20, 2021 Solution Share Posted January 20, 2021 This should be resolved in the next release which you can preview at https://assets.codepen.io/16327/ScrollToPlugin3.min.js Thanks for letting us know about it. 1 Link to comment Share on other sites More sharing options...
khudiiash Posted January 29, 2021 Author Share Posted January 29, 2021 On 1/18/2021 at 5:15 PM, ZachSaucier said: autoKill: true is the default for scrollTo tweens so you can leave that out. I tested the sample. Indeed, onAutoKill callback works correctly. Thank you! However, despite you said that autoKill is true by default, I could not see that in both current and future releases. It's not really a problem, but I just wanted to let you know. Here's a codepen. See the Pen ExNxWKZ by khudiiash-the-bold (@khudiiash-the-bold) on CodePen Link to comment Share on other sites More sharing options...
GreenSock Posted February 1, 2021 Share Posted February 1, 2021 Sorry about the confusion there. I've updated the docs. autoKill was true by default originally, but over time it became apparent that people most often wanted it OFF by default, so we changed it a while back. 2 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