1

I have a keyframe animation, that infinitly loops.

-webkit-animation: fade 3s ease-in-out infinite;

@-webkit-keyframes fade {
0% { opacity: 0; -webkit-transform: rotate(0deg);}
20% { opacity: 1; -webkit-transform: rotate(360deg);}
100% { opacity: 0; -webkit-transform: rotate(360deg);}
}

How can I delay each ilteration of the loop. im aware I can delay teh entire animation, but this only occurs once. I wish to do it everytime.

1
  • have the opacity: 0 occur at 50% through 100% for instance Commented Dec 10, 2013 at 16:18

1 Answer 1

2

Unfortunately there is no current option to easily put a delay between the iterations, but instead you can add another stop with the same values (as I commented), and increase the duration:

@keyframes fade {
    0% { opacity: 0; transform: rotate(0deg); }
    10% { opacity: 1; transform: rotate(360deg); }
    50% { opacity: 0; transform: rotate(360deg); }
    100% { opacity: 0; transform: rotate(360deg); }
}

.selector {
    animation: fade 6s ease-in-out infinite; /* increased duration */
}

Demo at http://jsfiddle.net/PW8Ur/2/

If you need scripted control over when you want to restart an animation, you could have a look at: http://css-tricks.com/restart-css-animation/

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.