Wymyśliłem sobie taka animację:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="pl">
<head>
<title>animacja</title>
<meta charset="utf-8">
<style>
html, body {overflow: hidden;}
@keyframes animacja
{
0% {left:100%;}
5%{left:30%;}
90%{left:30%;}
100%{left:-110%}
}
#animacja img
{
position:absolute;
margin:0 auto;
left: 100%;
height:280px;
width:450px;
}
#animacja img:nth-of-type(1)
{
animation: animacja 6s 0s linear infinite normal;
-webkit-animation: animacja 6s 0s linear infinite normal;
}
#animacja img:nth-of-type(2)
{
animation: animacja 6s 6s linear infinite normal;
-webkit-animation: animacja 6s 6s linear infinite normal;
}
#animacja img:nth-of-type(3)
{
animation: animacja 6s 12s linear infinite normal;
-webkit-animation: animacja 6s 12s linear infinite normal;
}
#animacja img:nth-of-type(4)
{
animation: animacja 6s 18s linear infinite normal;
-webkit-animation: animacja 6s 18s linear infinite normal;
}
</style>
</head>
<body>
<div id="animacja">
<img src="http://css3.bradshawenterprises.com/images/Birdman.jpg">
<img src="http://css3.bradshawenterprises.com/images/Turtle.jpg">
<img src="http://css3.bradshawenterprises.com/images/Rainbow%20Worm.jpg">
<img src="http://css3.bradshawenterprises.com/images/Windows%20Logo.jpg">
</div>
</body>
</html>
Wszystko ładnie się zaczyna, animują się kolejno obrazki ale tylko do ostatniego. Zapętla się tylko "img:nth-of-type(4)" a chciałbym aby całość była w nieskończonej pętli. W animacji poniekąd sugerowałem się rozwiązaniem ze strony: http://css3.bradshawenterprises.com/cfimg/#cfimg3 a dokładnie akapitem "Demo with multiple images" gdzie animacja jest właśnie zapętlona. Być może potrzebny jest jakiś skrypt js ale nie jestem w stanie tego ustalić :(
Co zrobić aby zapętlić taką animację?