Efecto visuales jquery animate
El método animate() de jQuery permite crear animaciones a partir de sus propiedades CSS en los elementos seleccionados.
$("#caja").animate( Propiedades, [ Duración], [ Función de animación ], [ Callback ] );
haz click sobre el siguiente botón ...
Bienvenidos al Manual Jquery
el código es el siguiente ...
<!-- By http://jquery-manual.blogspot.com -->
<!DOCTYPE HTML>
<html>
<head>
<script type='text/javascript' src='http://code.jquery.com/jquery-1.7.2.min.js'></script>
<script type="text/javascript">
$(document).ready(function() {
$("#caja").css({
width: "200px",
height: "15px",
backgroundColor: "yellow",
borderStyle: "solid",
borderColor: "blue",
borderWidth: "3px",
fontFamily: "Verdana",
padding: "20px",
fontSize: "12px",
textAlign: "center",
color: "blue"
});
$(":button#boton").click(function(){
$("#caja").animate({
height : "+=50",
width : "+=50"}
,2000
,function(){alert("terminado");
$("#caja").animate({height : "-=50", width : "-=50"}, 4000);
});
});
});
</script>
</head>
<body>
<input type="button" id="boton" value="Empezar">
<div id="caja" rel="show hide" title="show hide">Bienvenidos al Manual Jquery</div>
</body>
</html>
No hay comentarios:
Publicar un comentario