0

I'm trying to get this loading bar: https://web.archive.org/web/20120608081511/http://www.webfroze.com/css/loading-animation-circle-style/

to repeat indefinitely.

I tried

-moz-animation:loading 1s infinite;
-webkit-animation:loading 1s infinite;

But this wont work since the animation is build up on 5 separate animated spheres which animate subsequent to one another, so setting them to repeat the infinite option messes it up

0

1 Answer 1

3

You need to add a rest in your animation, a part where nothing happens, so you can imitate delay.

css:

#layer1 { -moz-animation-delay:0.3s; -webkit-animation-delay:0.3s; }
#layer2 { -moz-animation-delay:0.6s; -webkit-animation-delay:0.6s; }
#layer3 { -moz-animation-delay:0.9s; -webkit-animation-delay:0.9s; }
#layer4 { -moz-animation-delay:1.2s; -webkit-animation-delay:1.2s; }
#layer5 { -moz-animation-delay:1.5s; -webkit-animation-delay:1.5s; }

@-moz-keyframes loading {
    0%{-moz-transform:scale(0,0);}
    25%{-moz-transform:scale(1,1);}  
    50%{-moz-transform:scale(1,1);} 
    75%{-moz-transform:scale(0,0);} 
    100%{-moz-transform:scale(0,0);} 
}

@-webkit-keyframes loading {
    0%{-webkit-transform:scale(0,0);}
    25%{-webkit-transform:scale(1,1);}  
    50%{-webkit-transform:scale(1,1);} 
    75%{-webkit-transform:scale(0,0);} 
    100%{-webkit-transform:scale(0,0);}    
}

Demo:
http://jsfiddle.net/Vf2aq/2/

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.