title: Using jQuery .each() to infinitely loop over elements
body: <p>I have a set of elements like this</p>
  
  <pre><code>&lt;div class="wrap"&gt;
      &lt;div class="block active"&gt;
          &lt;p&gt;content&lt;/p&gt;
      &lt;/div&gt;
      &lt;div class="block"&gt;
          &lt;p&gt;content&lt;/p&gt;
      &lt;/div&gt;
      &lt;div class="block"&gt;
          &lt;p&gt;content&lt;/p&gt;
      &lt;/div&gt;
      &lt;div class="block"&gt;
          &lt;p&gt;content&lt;/p&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I need a function to infinitely loop on these elements (block) moving the active class from one to the next. I've looked at using .each() for this but I don't really understand how to use it. Any help is greatly appreciated.</p>