Jump to content


ScrollToPlugin onFinish callback?

Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

Hey guys!


I really like your ScrollToPlugin and because of the "autoKill" it really fixes a lot of bugs for me.

Still I'm looking for that callback on finish like JS' anim() function has it. Since the documentation doesn't show all parameters which I can deliver to the to() function (i.e. "duration" and "delay" which I only found while browsing the function definition of the plugin) I want to ask you guys if there is a way to clip a function on end or finish animation anyhow?


And btw. I have an issue when using this on a Smartphone view the touching still inteferes the autoKill : false. It's kind of a jumpback when I swipe while the animation runs. Does ScrollToPlugin has a way to get rid of that as well?




Thanks for your help!

Link to comment
Share on other sites

To call a function at the end of the tween, just use an onComplete. 

TweenLite.to(window, 1, {scrollTo:{y:100, autoKill:false}, onComplete:yourFunction});

As for the smartphone touch thing, you could just set up a touch listener that'll kill any tweens of the window using TweenLite.killTweensOf(window) (or if you're not animating the scroll of the window, just replace that with whatever element/object you're animating). 

  • Like 1
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.