Header Ads

animate() method using jQuery

<html>
<head>
<script type="text/javascript" src="jquery-1.2.6.js"></script>
<script>
$(document).ready(function()
{
$("#btnAnimate").click(function(){
$("#boxanimate").animate({height:"400px"});//Increase the height
});
$("#btnReset").click(function(){
$("#boxanimate").animate({height:"200px"});//Decrease the height
});
});
</script>
</head>
<body>
<button id="btnAnimate">Animate height</button>
<button id="btnReset">Reset height</button>
<div id="boxanimate" style="background:#2E4270;height:200px;width:200px;margin:7px;">
</div>
</body>
</html>

No comments:



Powered by Blogger.