Share Posted July 14, 2020 The carousel switches the images properly but there seems to be a jank in the animation when it restarts. Opening dev tools, it shows that the opacity changes from 0 to 1 immediately instead of transitioning like the others. See the Pen LYGJNdY by ebinabo (@ebinabo) on CodePen Link to comment Share on other sites More sharing options...
Share Posted July 14, 2020 Hey ebinabo. The main issue here is that you are trying to animate the original image from an opacity of 1 to opacity of 1, so naturally it you can't perceive the animation (because the value is always the same). In general you should avoid using onCompletes to reset variables in your animations. It's a whole lot cleaner to create animations beforehand and just let them do their thing, controlling them with control methods as necessary. In fact, not doing so is one of the most common GSAP mistakes. I might set it up along the lines of this: See the Pen ExPegPX?editors=0010 by GreenSock (@GreenSock) on CodePen 5 Link to comment Share on other sites More sharing options...
Author Share Posted July 15, 2020 @ZachSaucier thank you so much. I just learnt that you could tl.add(anotherTl) lol and that's so cool! Now I'm gonna take it to the next level! 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