Jump to content
Search Community

Animation not ending

Sean_has_started_coding test
Moderator Tag

Recommended Posts

Hello all

 

Hope everyone is well.

I have put together an animation with a number of elements repeat indefinitely. Because of this, the animation does not end.

I am sure there's a simple fix for this, but I can't see how I can end the animation.
At the end of all my other animations, the text in the button switches to 'Play' but in this animation, the text 'Pause' is visible indefinitely.
(Please disregard the missing image for now)
Any help as ever would be appreciated.

Thank you.

See the Pen vYVbzPe by HappyGooner (@HappyGooner) on CodePen

Link to comment
Share on other sites

Hi @Sean_has_started_coding I don't have time to fix your animation, but I would advise creating functions of sections of the timeline and add those to a main timeline, this will not only be easier to manage (and edit at a later time), but allows you to have looping stuff, without clogging up the main timeline. 

 

Here is an example I've made years ago (don't pay attention to the old GSAP syntax), but the logic should still apply. At line 74 I have a main timeline which has all kinds of other timelines add to it, some repeating, some not and as you can see you get a console.log when the mainTl has finished. Hope it helps and happy tweening! 

 

See the Pen WMdWxG?editors=0011 by mvaneijgen (@mvaneijgen) on CodePen

  • Like 2
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...