Only perform function on child of clicked on element
Hi,
I'm pretty new to jQuery, so my attempts to find the right way of doing this haven't yet worked.
What I want to do is find the divs with the class .togbox and then use the slideToggle function to toggle the display of the .inside div.
I can do that fine, with one problem; because I have to use classes, not IDs, when i click on the handle for one, it opens all of the content for the other elements too. How can I limit the slideToggle to just the exact element clicked on?
I've tried parent/sibling etc, but haven't worked it out yet.
I have the following code so far:
-
$(document).ready(function(){
$(".togbox").click(function(){
$(".inside").slideToggle("slow");
$(this).toggleClass("active");
});
});
What do I need to add?
Thanks in advance