title: How to find out when next() reaches the end, then go to the first item
body: <p>I am displaying a series of elements using the next() function. Once I reach the end though, I want to go to the first element. Any ideas?</p>
  
  <p>Here's the code: </p>
  
  <pre><code>//Prev / Next Click
  $('.nextSingle').click( function() {
      //Get the height of the next element
      var thisHeight = $(this).parent().parent().parent().next('.newsSingle').attr('rel');
      //Hide the current element
      $(this).parent().parent().parent()
          .animate({
              paddingBottom:'0px',
              top:'48px',
              height: '491px'
          }, 300) 
          //Get the next element and slide it in      
          .next('.newsSingle')
          .animate({
              top:'539px',
              height: thisHeight,
              paddingBottom:'100px'
          }, 300);
  });
  </code></pre>
  
  <p>Basically I need an "if" statement that says "if there are no remaining 'next' elements, then find the first one.</p>
  
  <p>Thanks!</p>