Share Posted July 12, 2022 Hi, I'm trying to get a background image .gif to change from one image to the another. I want the animation to change from Homer to Leo and repeat endlessly. I'm just after a straight cut in the transition so i thought .set would do it rather than a .to or .from with opacity etc. Thanks for the help, Phil See the Pen jOzMNry by phillipanthonyvale (@phillipanthonyvale) on CodePen Link to comment Share on other sites More sharing options...
Share Posted July 12, 2022 Hey there, You'll get a straight cut anyway with a to tween as you can't animate between different background images - there's no 'in between' state. It's either one image or the other. But whether you're using set or to you're going to need to add some position parameters and maybe a repeatDelay so that your tweens are spaced out. Right now they're both happening at the same time (set is 0 duration) See the Pen XWEjXMj?editors=1111 by GreenSock (@GreenSock) on CodePen I've also updated your timeline to use the latest syntax and not timelineMax (that's version 2) Hope this helps! Link to comment Share on other sites More sharing options...
Author Share Posted July 13, 2022 Amazing, thanks so much Cassie! Just a quick question. What happens to the gifs when they aren't showing are they still playing in the background? OR does the .set function sort of turn them off? 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