Javascript examples for jQuery Method and Property:animate
moves a <div> element to the right, until it has reached a left property of 250px:
<!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script> $(document).ready(function(){ $("button").click(function(){ $("div").animate({left: '250px'}); });/* www . jav a 2 s. co m*/ }); </script> </head> <body> <button>Start Animation</button> <div style="background:#98bf21;height:100px;width:100px;position:absolute;"></div> </body> </html>