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>:
- <div class="project">
- <p>There is content here, but no links except the ones below</p>
- <a href="image.jpg" rel="gallery"></a>
-
<a href="image2.jpg" rel="gallery"></a>
- </div>
So I wrote a little function that should trigger the click event on the first A:
- $("div.project").click(function () {
- $(this).find("a").first().click();
- });
But somehow, this creates a loop...
Any ideas?
Thanks!