Why doesn't my selector work?

Why doesn't my selector work?

Hi,

When I click on a <div> it needs to open a colorbox for all links that are contained within the <div>:

  1. <div class="project">
  2.       <p>There is content here, but no links except the ones below</p>
  3.       <a href="image.jpg" rel="gallery"></a>
  4.        <a href="image2.jpg" rel="gallery"></a>
  5. </div>

So I wrote a little function that should trigger the click event on the first A:

  1. $("div.project").click(function () {
  2. $(this).find("a").first().click();
  3. });

But somehow, this creates a loop...

Any ideas?

Thanks!