How to use animate() method using jQuery?


In this article I'm going to explain How to use animate() method using jQuery. Just drag and drop two button control to your asp.net web page.

In this article I'm going to explain How to use animate() method using jQuery. Just drag and drop two button control to your asp.net web page.

Example:-


<html>
<head>
<script type="text/javascript" src="jquery-1.2.6.js"></script>
</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>


Comments

No responses found. Be the first to comment...


  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: