JQuery Animate

 

To manipulate the position, You need to set the CSS position property of the element. For the similar work, JQuery animate() method is used to create custom animations.

 
 
 
<!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(){ $("div").animate({ left:'500px', opacity:'0.6', height:'250px', width:'250px' }); }); }); </script> </head> <body> <button class="btn1">Animation</button><br><br> <div class="box" style="background:brown;height:100px;width:100px;position:absolute;"> </div> </body> </html>
Output