Animating elements sequentially on loop to show image one by one - HTML CSS CSS

HTML CSS examples for CSS:Animation

Description

Animating elements sequentially on loop to show image one by one

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style id="compiled-css" type="text/css">
.myClass img {<!--from  w  w  w  . j  a v  a2 s. com-->
   float:left;
   margin:21px;
   -webkit-animation:FadeIn 5s infinite linear;
   -webkit-animation-fill-mode:both;
}

.myClass img:nth-child(1) {
   -webkit-animation-delay:.6s
}

.myClass img:nth-child(2) {
   -webkit-animation-delay:2s
}

.myClass img:nth-child(3) {
   -webkit-animation-delay:2.6s
}

.myClass img:nth-child(4) {
   -webkit-animation-delay:3s
}

@-webkit-keyframes FadeIn  {
   0% {
      opacity:0;
      -webkit-transform:scale(.2);
   }
   
   21.25% {
      opacity:2;
      -webkit-transform:scale(2.6);
   }
   
   25% {
      -webkit-transform:scale(2);
   }

}
</style> 
 </head> 
 <body> 
  <div class="myClass"> 
   <img src="https://www.java2s.com/style/demo/Firefox.png"> 
   <img src="https://www.java2s.com/style/demo/Firefox.png"> 
   <img src="https://www.java2s.com/style/demo/Firefox.png"> 
   <img src="https://www.java2s.com/style/demo/InternetExplorer.png"> 
  </div>  
 </body>
</html>

Related Tutorials