hateusall Posted February 9, 2021 Share Posted February 9, 2021 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 More sharing options...
Solution ZachSaucier Posted February 9, 2021 Solution Share Posted February 9, 2021 You can only call one function in the onToggle. But you can easily call two functions from that function: onToggle: () => { countingNumbers1(); countingNumbers2(); } 1 Link to comment Share on other sites More sharing options...
hateusall Posted February 9, 2021 Author Share Posted February 9, 2021 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now