title: Looping jQuery function
body: <p>I have small animation made with jQuery (panels goes up and comes down). But I am not able to make it a loop. So it would do it continuesly. Here's the code so far:</p>
  
  <pre><code>$(document).ready(function() {
  
      startAni();   
  
  });
  
  function startAni() {
      setTimeout(function() {
          $('.ani .panels').animate({
              top: '-350px',
          }, 2500, function() {
              setTimeout(function() {
                  $('.ani .panels').animate({
                      top: '0px',
                  }, 2500, function() {
                  });
              }, 1000);
          });
      }, 1000);
  
  
      //startAni();
  }
  </code></pre>
  
  <p>So it works perfectly once (the panels div goes up, stays there for 1sec and then comes back down. How can I change this in to loop? I tried calling the same function inside the function but that just killed it :/</p>
  
  <p>Thanks!</p>