sábado, 18 de febrero de 2012

Imagenes con rotacion y zoom

Hola amigos , en esta entrada les traigo un efecto genial para nuestras imagenes ,como lo dice el título de la entrada se trata de que las imagnes rotan y al rotar se agrandan.

Lo primero que debemos hacer es pegar el siguiente código antes de </b:skin>

@-webkit-keyframes rotater {
    0% { -webkit-transform:rotate(0) scale(1) }
50% { -webkit-transform:rotate(360deg) scale(2) }
100% { -webkit-transform:rotate(720deg) scale(1) }
}

a.advert    { width:125px; height:125px; display:block; }
a.advert:hover {
    /* safari / chrome */
    -webkit-animation-name:rotater;
    -webkit-animation-duration:500ms;
    -webkit-animation-iteration-count:1;
    -webkit-animation-timing-function: ease-out;
   
    /* mozilla */
    -moz-transform:rotate(360deg) scale(2);
    -moz-transition-duration:500ms;
    -moz-transition-timing-function: ease-out;
   
    /* opera */
    -o-transform:rotate(360deg) scale(2);
    -o-transition-duration:500ms;
    -p-transition-timing-function: ease-out;
   
    /* ie */
    -ms-transform:rotate(360deg) scale(2);
    -ms-transform-duration:500ms;
    -ms-transform-timing-function: ease-out;
}


Con esto ya tenemos los estilos , ahora debemos hacerlos actuar. Para eso vamos a utilizar el siguiente código para agregar las imagenes.


<div style="width:125px;float:left;overflow:hidden;height:125px;margin-right:20px;">
    <a href="#" class="advert"><img src="URL DE LA IMAGEN"/></a>
</div>

<div style="width:125px;float:left;overflow:hidden;height:125px;margin-right:20px;">
    <a href="#" class="advert"><img src="URL DE LA IMAGEN"/></a>
</div>

Para agregar otra imagen solamente debemos copiar este código y reemplazar lo que se pide.

<div style="width:125px;float:left;overflow:hidden;height:125px;margin-right:20px;">
    <a href="#" class="advert"><img src="URL DE LA IMAGEN"/></a>
</div>

 Aclaraciones : 

TODAS las cosas que se  encuentran en negrita pueden ser cambiadas.

width:125px y height:125px : Lo alto y lo ancho de la imagen .
# : Esto puede ser reemplazado por un link si queremos .




Las imagenes nos quedarán de este modo :













No hay comentarios:

Publicar un comentario