Girar imagenes con un click
COMO HACER QUE GIRE UNA IMAGEN CODIGO CSS CON JAVASCRIPT
//<![CDATA[
$('#girar').on("click", function(e) {
e.preventDefault();
$('#girar').addClass('giro');
var t1 = setTimeout(function() {
$('#girar').removeClass('giro');
}, 1000);
});
//]]>
</script>
<style>
#girar {
position: relative;cursor:pointer;
-webkit-transition: all 500ms ease-in-out;
-moz-transition: all 500ms ease-in-out;
-o-transition: all 500ms ease-in-out;
-ms-transition: all 500ms ease-in-out;
}
#girar.giro {
-webkit-transform: rotate(90deg);
-moz-transform: rotate(90deg);
-ms-transform: rotate(90deg);
-o-transform: rotate(90deg);
transform: rotate(90deg);
zoom: 1;
}
</style>
$('#girar').on("click", function(e) {
e.preventDefault();
$('#girar').addClass('giro');
var t1 = setTimeout(function() {
$('#girar').removeClass('giro');
}, 1000);
});
//]]>
</script>
<style>
#girar {
position: relative;cursor:pointer;
-webkit-transition: all 500ms ease-in-out;
-moz-transition: all 500ms ease-in-out;
-o-transition: all 500ms ease-in-out;
-ms-transition: all 500ms ease-in-out;
}
#girar.giro {
-webkit-transform: rotate(90deg);
-moz-transform: rotate(90deg);
-ms-transform: rotate(90deg);
-o-transform: rotate(90deg);
transform: rotate(90deg);
zoom: 1;
}
</style>
© REDEANDO Blog
No hay comentarios.:
Publicar un comentario