Share Posted October 12, 2017 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') } See the Pen wrXwra by garethj (@garethj) on CodePen Link to comment Share on other sites More sharing options...
Share Posted October 12, 2017 Hi @gareth, This could be a way ... See the Pen 741e3ab4de1b92f3aa91e2b195da8037 by mikeK (@mikeK) on CodePen Happy tweening Mikel 4 Link to comment Share on other sites More sharing options...
Share Posted October 12, 2017 Great solution by @mikel, which sparked and idea to use a jQuery forEach loop See the Pen Yrjemg?editors=1010 by GreenSock (@GreenSock) on CodePen 5 Link to comment Share on other sites More sharing options...
Author Share Posted October 13, 2017 amazing, thank you both. I have made a small update to yours @Carl so we do not need jquery. See the Pen YrOWOK by garethj (@garethj) on CodePen 1 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