Jump to content
Search Community

Stagger onComplete for individual elements within a batch

tomw_uk test
Moderator Tag

Go to solution Solved by OSUblake,

Recommended Posts

Hi there,

 

I'm trying to trigger some additional javascript within the `onComplete` callback on stagger within ScrollTrigger.batch().

 

I found this thread but `this` is undefined when I put it inside a batch call like so:

 

ScrollTrigger.batch('.show', {
  onEnter: (elements, triggers) => {
    gsap.to(elements, { y: 0, opacity: 1, duration: 1, stagger: {
      each: 0.3,
      onComplete: () => {
        console.log(this)
      }
    } })
  },
})

Is there any way I can I can access the element when its animation has finished?

 

Thanks in advance,

Tom.

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