title: Jquery each() Counter
body: <p>I've done some searching around the documentation, and spent a while on the net but cannot find a solution to this! I want the alert to tell me which iteration of each() it was on when the .thumb is clicked.</p>
  
  <p>EG: There are six .thumb's I click on number 3, the browser pops-up 3!</p>
  
  <p>What actually happens is regardless of which .thumb is clicked, 6 pops up.</p>
  
  <pre><code>var counter = 1;
  $('.thumb').each(function () {
      $(this).click(function () {
          alert (counter);
      });
      counter++;
  });
  </code></pre>
  
  <p>Any help is gratefully received.</p>