Jump to content
GreenSock

hateusall

How do I use more than one funcition on ScrollTrigger OnToggle?

Moderator Tag
Go to solution Solved by ZachSaucier,

Recommended Posts

How do I use more than one fucntion on onToggle? I managed to make it work with one function, but when I tried to use more than one both doesn't work.

 

tl_numbers = gsap.timeline({
    scrollTrigger: {
        trigger: ".counter-sec",
        start:"top 100%"
        toggleActions: "play reset resume reset",
        onToggle: countingNumbers1 + countingNumbers2
      }
})
Link to comment
Share on other sites

  • Solution

You can only call one function in the onToggle. But you can easily call two functions from that function:

onToggle: () => {
  countingNumbers1();
  countingNumbers2();
}

 

  • Like 1
Link to comment
Share on other sites

4 minutes ago, ZachSaucier said:

You can only call one function in the onToggle. But you can easily call two functions from that function:


onToggle: () => {
  countingNumbers1();
  countingNumbers2();
}

 

Thank you. It worked!

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