首页javascriptrepeatjQuery Animation - 如何重复动画

jQuery Animation - 如何重复动画

我们想知道如何重复动画。

<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'
  src='http://code.jquery.com/jquery-1.9.1.js'></script>
<script type='text/javascript'>
$(document).ready(function(){
   setInterval(callMe,2000);
});
function callMe(){
   $("div").animate({left:'250px'}).fadeOut().animate({left:'0'}).fadeIn();
}

</script>
</head>
<body>
  <button>Start Animation</button>
  <br />
  <br />
  <div
    style="background: #98bf21; height: 100px; width: 100px; position: absolute;">
  </div>
</body>
</html>