samuelhigginson Posted December 9, 2022 Posted December 9, 2022 Just trying to get a random interval for each image, but can't seem to figure what I'm doing wrong.. ? See the Pen RwJOpWX?editors=0010 by halfvillain (@halfvillain) on CodePen.
Solution GreenSock Posted December 9, 2022 Solution Posted December 9, 2022 I noticed a few problems: You were trying to set a duration on a timeline, but timelines are just wrappers for other tweens/timelines, so their duration is determined by their contents. You were trying to make the interval between 1000 and 2000 seconds (a long time!) Since you didn't populate the timeline with anything, it had no duration at all, thus onRepeat is pretty meaningless. I assume you were looking for something more like this?: See the Pen YzvMZJX?editors=1010 by GreenSock (@GreenSock) on CodePen. Just so you know, gsap.utils.random() is magical in that you can give it an Array and it'll automatically return a random element from that Array, so you don't have to manage the index. ? 2
samuelhigginson Posted December 9, 2022 Author Posted December 9, 2022 * face palms * They were left over from when I was using setInterval! Totally missed it... twice! Cheers Jack, and thanks for the additional info. 1
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