Ver Mensaje Individual
  #2 (permalink)  
Antiguo 05/11/2014, 05:41
AitorLopez
 
Fecha de Ingreso: mayo-2009
Mensajes: 742
Antigüedad: 15 años
Puntos: 6
Respuesta: Animacion de imagenes en css

Mirad, he ido avanzando con el tema y he llegado hasta aqui, pero no se porque no me funciona

Código HTML:
Ver original
  1.   <div class="col-xs-12">
  2.    
  3.     <style>
  4.       .padre{position: relative;}
  5.      
  6.       .hijos{width: 30px; height: 30px;position: absolute}
  7.      
  8.       .hijo1{left: 0%; top: 0%;}
  9.       .hijo2{left: 0%; top: 100%;}
  10.       .hijo3{left: 100%; top: 0%;}
  11.       .hijo4{left: 100%; top: 100%;}
  12.      
  13.       .padre:hover{
  14.         -moz-animation: 2s iberis 1;
  15.         -webkit-animation: 2s iberis 1;
  16.       }
  17.      
  18.       @-moz-keyframes iberis {
  19.         0% {
  20.           .hijo1{left: 0%; top: 0%;}
  21.           .hijo2{left: 0%; top: 100%;}
  22.           .hijo3{left: 100%; top: 0%;}
  23.           .hijo4{left: 100%; top: 100%;}
  24.         }
  25.  
  26.         100% {
  27.           .hijo1{left: 45%; top: 45%;}
  28.           .hijo2{left: 55%; top: 45%;}
  29.           .hijo3{left: 55%; top: 45%;}
  30.           .hijo4{left: 55%; top: 55%;}
  31.         }
  32.       }
  33.  
  34.      
  35.     </style>
  36.    
  37.     <div class="padre" style="width: 300px; height: 300px; background-color: red">
  38.      
  39.       <div class="hijos hijo1" style="background-color: blue"></div>
  40.       <div class="hijos hijo2" style="background-color: greenyellow"></div>
  41.       <div class="hijos hijo3" style="background-color: yellow"></div>
  42.       <div class="hijos hijo4" style="background-color: violet"></div>
  43.      
  44.     </div>
  45.    
  46.   </div>