Title doesn't really give this thread justice ... I have a content div with an image and text included into it. This same div class is being used multiple times. What I want is to be able to click the image, and have the <p> in that div toggle to show or hide.
Here is the XHTML code for the front-end:
<div class="content">
<img src="image_big.gif" alt="image" class="toggle_font" />
<p> Caption for the next image. </p>
</div>
Here is the jQuery code that I am using:
$('.toggle_font', this).click(function(){
$("div.content").find("p").toggle(2000);
});
When I click on the image all of the <p> throughout the page toggles. I want only that div to toggle.
I hope that people understand what I am trying to say ... thankyou in advance.