.animate() question, can this be with pause?
Hi there,
I have the following code form the api example:
<!DOCTYPE html> <html> <head> <style> div { position:absolute; background-color:#abc; left:50px; width:90px; height:90px; margin:5px; } </style> <script src="http://code.jquery.com/jquery-1.5.js"></script> </head> <body> <button id="left">«</button> <button id="right">»</button> <div class="block"></div> <script> $("#right").click(function(){ $(".block").animate({"left": "+=250px"}, "slow"); }); $("#left").click(function(){ $(".block").animate({"left": "-=250px"}, "slow"); }); </script> </body> </html>
This moves the div 250px to the right (or left) when clicking the button. Now is the following also possible?
I want it so that when I click the button the div moves to the right (250px) then waits for 5 sec and then moves another 250px to the right (whitout needing to click again). And how to do that?
Thanks