Jump to content
Search Community

scrollToPlugin onAutoKill callback not firing / timeline issues

khudiiash test
Moderator Tag

Go to solution Solved by GreenSock,

Recommended Posts

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

  • Thanks 1
Link to comment
Share on other sites

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.
  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...
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

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