Simple animation using jQuery

This is a post in which the demonstration of various types of animations in jQuery is shown.


In this, when the button is clicked, the div scales it self then inside the div, the font also scales it's size.

Demo


jQuery Animation

The Code
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script>
$(document).ready(function(){
  $("button#bDemo").click(function(){
    $("div#divDemo").animate({left:"170px",height:"190px",width:"400px",opacity:"0.5"},"slow");
    $("div#divDemo").animate({fontSize:"5em"},"slow");
  });
});
</script>
<style>
#bDemo{
 color: #fff !important;
 background-color: #2196F3 !important;
}
#divDemo{
 border:1px solid #555;
 border-radius:3px;
 color:white;
 background:#555;
 height:20px;
 width:120px;
 position:relative;
}
</style>
<button id="bDemo">Start Animation</button><br/>
<div id="divDemo">jQuery Animation</div>

Got any questions to ask ?
Comment them right here !

Comments

Popular posts from this blog

Non Restoring Division Algorithm Implementation in C

Hackerrank Modified Kaprekar Numbers Solution

Bit Stuffing Code Implementation in Java