gareth

on compete of staggerTo

Recommended Posts

I have a text animation that shows one word at a time. Is there a way I can fire a function at the end of each staggerTo (i.e each paragraph?)

 

This is what I have: 

 

tl.staggerTo(mySplitText.words, speed, {display:'block',repeat:1,yoyo:true}, speed*2,endOf)

function endOf() {
  console.log ('end of paragraph')
}

 

Share this post


Link to post
Share on other sites

Hi @gareth,

 

This could be a way ...

 

 

Happy tweening

Mikel

  • Like 4

Share this post


Link to post
Share on other sites

Great solution by @mikel, which sparked and idea to use a jQuery forEach loop 

 

 

  • Like 5

Share this post


Link to post
Share on other sites

amazing, thank you both. I have made a small update to yours @Carl so we do not need jquery. 

 

 

  • Like 1

Share this post


Link to post
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.