Jump to content
Search Community

How to run onComplete with returning timeline from function

Daniel Hult test
Moderator Tag

Recommended Posts

Hi guys,

This might be very easy, but not sure how to do it. If I have this function here that returns a timeline:

export const enterTextAnimation = text => {

    const tl = gsap.timeline();

    tl.to(text, {
      y: '-100%',
      opacity: 0,
      stagger: 0.014,
    });

    return tl;
};

And I later use the function like the first line here:
How can I run a function onComplete here?

const tl = enterTextAnimation(lines.chars);



tl.onComplete() (?)...
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...