huy Posted April 13, 2020 Share Posted April 13, 2020 Is there a way to make a gsap timeline execute a callback every x seconds? I'm thinking of something like gsap.delayedCall() but it would mimic setInterval instead of setTimeout. Thanks! Link to comment Share on other sites More sharing options...
GreenSock Posted April 13, 2020 Share Posted April 13, 2020 Sure, do you mean something like this?: // assuming you want myFunc to fire every 1 second... gsap.set(myFunc, {delay: 1, onRepeat: myFunc, repeat: -1, repeatDelay: 1}); 5 Link to comment Share on other sites More sharing options...
huy Posted April 16, 2020 Author Share Posted April 16, 2020 Hi Jack, Thanks for the reply. What does `repeat: -1` do? It seems to be undocumented. Link to comment Share on other sites More sharing options...
GreenSock Posted April 16, 2020 Share Posted April 16, 2020 repeat: -1 is just a special value that means "repeat forever". It is in the docs, but not everywhere it needed to be, so I added it in a few places. Thanks for letting us know. Happy tweening! 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