Share Posted May 20, 2021 Hi all I'm trying to animate the "writing" of random text on repeat. Here's what I came up with so far: gsap.to('#text', {duration:10, repeat:-1, repeatRefresh:true, text:{value:rndstr(27)}}) rndstr(x) is a custom function that returns a random string of lenght x. This works fine the first time it's running (it fills the div with a random 27-char string as expected, however it doesn't seem to repeat (or at least it won't fetch a new string on repeat). Is my use of "repeatRefresh" not sufficient to have gsap fetch a new string? What am I missing? See the Pen BaWpWPq by remo-pini (@remo-pini) on CodePen Link to comment Share on other sites More sharing options...
Solution Solution Share Posted May 20, 2021 1 minute ago, remopini said: What am I missing? A function to call on every refresh. gsap.to('#textbox1', { duration: 1, // duration should be a number, not a string repeat:-1, repeatRefresh:true, ease:"none", text:{value: () => rndstr(20)} }) 3 Link to comment Share on other sites More sharing options...
Author Share Posted May 20, 2021 Great! Thx. Codepen updated to reflect solution. 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