title: jQuery test for if a div is the first child?
body: <p>How to do test if a image is the first or the last of a group of images?</p>
  
  <p>I'm trying to make previous and next buttons animate in or out depending on whether I'm at the end of a series of images with the following code:</p>
  
  <pre><code>var $current = jQuery("img .active");
  var $next = $current.next();
  
  if ($next != jQuery("img:first-child")
  {
   // show next item and the previous button
   // seems to work?
  
  } else if ($next == jQuery("img:last-child")
  {
   // hide the next button since we're at the end
   // doesn't seem to work??
  }
  </code></pre>