The problem is if you need a repeated cycle of animation, the cycle time of all the animations should be equal. The cycle time here is the total of animation-duration
and animation-delay
. So you can't set the same animation-duration
but with different animation-delay
s. In fact it's totally OK if right after the first cycle, we can remove all the animation-delay
(set all to 0
), of course this could be done only by script.
So I think you should use the same animation-duration
(as the cycle time) and set different animation-name
s (we need to use different keyframes for each animation). Here are the code details:
@-webkit-keyframes anim_slides {
0%, 23%, 100% {opacity:1;}
36%, 90% {opacity:0;}
}
@-webkit-keyframes anim_slides2 {
0%, 23%, 69%, 100% {opacity:0;}
36%, 56% {opacity:1;}
}
@-webkit-keyframes anim_slides3 {
0%, 56%, 100% {opacity:0;}
69%, 89% {opacity:1;}
}
.slides ul li:nth-child(1), .slides ul li:nth-child(1) div {
-webkit-animation-name: anim_slides;
}
.slides ul li:nth-child(2), .slides ul li:nth-child(2) div {
-webkit-animation-name: anim_slides2;
}
.slides ul li:nth-child(3), .slides ul li:nth-child(3) div {
-webkit-animation-name: anim_slides3;
}
As you can see, the time of opacity:1
for each animation is just 20% of the animation-duration
. To build those keyframes, you have to calculate carefully, otherwise the effect won't be as expected. Now, you can just change the animation-duration
(which is used for all the animation) easily to change the frequency.