JQuery Multiple Amimate()

 

We use jQuery animate() method to create custom animations. If you write multiple animate() calls after each other, jQuery creates an "internal" queue with these method calls. Then it runs the animate calls ONE by ONE.

 
 
 
<!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.0/jquery.min.js"></script> <script> $(document).ready(function(){ $(".btn1").click(function(){ var div = $("div"); div.animate({left: '400px'}, "slow"); div.animate({fontSize: '3em'}, "slow"); }); }); </script> </head> <body> <button class="btn1">Animation</button><br><br> <div style="background:brown;height:200px;width:200px;position:absolute;"> Welcome</div> </body> </html>
Output