Pause timeline at the end of repeat

Recommended Posts

Hi everyone, my situation is this:


I have two timelines, one for the loading initial animation and another one for the coreography when the page is loaded.
The animation of the loader (a spinner) is made more or less the same as the codepen linked but in this way, as you can see, the rotation doesn't stop properly. (In simple words i want to pause the rotation animation WHEN the page is loaded, but I doesn't want to stop that if it's still moving)

    .to(test, 1, {rotation: "+=90", repeat: -1, repeatDelay: 1, onRepeat: loaded});
  function loaded(){
    tlOpening.play(); //this one is not included in the codepen


I need to find another way to stop the repeat animation at the end of the repeat animation because in this way it makes a little step forwards.



Share this post

Link to post
Share on other sites

Hi dghez :)


I'm not quite sure of your desired behavior here, but wouldn't your spinning animation disappear once the content has loaded? 


If you're creating a loader animation, this post should help:



Jonathan has a nice simulated loader animation here:



Hopefully that helps a bit.


Happy tweening.


Share this post

Link to post
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.