Run ❯
Get your
own
website
Result Size:
625 x 565
×
Change Orientation
Save Code
Change Theme, Dark/Light
Go to Spaces
<!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script> <script> $(document).ready(function(){ $(".btn1").click(function(){ $("body").animate({ backgroundPositionX: "+=100px", backgroundPositionY: "+=200px" }); }); $(".btn2").click(function(){ $("body").animate({ backgroundPositionX: "0px", backgroundPositionY: "0px" }); }); }); </script> </head> <body style="background-image:url('/images/w3jquery.gif');background-repeat:no-repeat;position:fixed"> <button class="btn1">Animate</button> <button class="btn2">Reset</button> </body> </html>