Jump to content
Search Community

ScrollTrigger Batch Kill

elegantseagulls test
Moderator Tag

Recommended Posts

So I'm having trouble killing a ScrollTrigger Batch without killing all the tweens on a page. I thought I could just use the ScrollTrigger.getAll('myID').forEach(st => st.kill('all')); , but this kills all the ScrollTriggers on the page. It also seems like I can't access them with the getById method either.

Any suggestions?

See simplified example of my usecase:

See the Pen wvPvXXZ?editors=0010 by ryan_labar (@ryan_labar) on CodePen

Link to comment
Share on other sites

7 hours ago, OSUblake said:

Also, I'm not sure what the "all" here is for.

Tween.kill() habits for kill is why "all" is in there. Good catch!

 

7 hours ago, GreenSock said:

Does that answer your question @elegantseagulls

Yes! Thank you!

 

Unfortunately, however, my batch setup isn't in same scope as where I'm killing it, so I don't have a good way to access that....

 

It'd be awesome to be able to getAllById('id') (especially for ScrollTriggers setup in a forEach loop) or getBatchById('id'), but maybe my use case isn't all that common. The way I've got it setup seems to work pretty well for what I'm doing in the meantime.

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