I'm looking to continuously loop the animate function in jQuery. Here's the code I have:
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"> </script>
<script type="text/javascript">
$(document).ready(function(){
$(".b").click(function(){
var a=$(".abb");
a.animate({top:'100px',left:'400px'},"slow");
a.animate({top:'20px',left:'500px'},"slow");
a.animate({top:'500px',left:'100px'},"slow");
a.animate({top:'100px',left:'800px'},"slow");
a.animate({top:'200px',left:'100px'},"slow");
a.animate({top:'300px',left:'0px'},"slow");
a.animate({top:'600px',left:'300px'},"slow");
a.animate({top:'100px',left:'700px'},"slow");
a.animate({top:'300px',left:'100px'},"slow");
});
});
</script>
</head>
<body>
<button class="b"> click </button>
<div class="abb" style="width:100px;height:100px;background:#9F0;position:absolute;border-radius:70px;box-shadow:#000 1px 1px 3px 2px;"></div>
</body>
</html>
Could someone help me modify this script to run continuously without stopping? Thank you!