I have several DIVs on my page that I would like to be able to expand / collapse. I’m using the code below to do so, but it only applies to an entire class.. Can I apply it to whatever is being clicked? (for example, self.slideToggle();)
// Activate Toggle for Showing / Hiding More Price Tables
$(".slidingDiv").hide();
$(".show_hide").show();
$('.show_hide').click(function(){
$(".slidingDiv").slideToggle();
return false;
});
});
EDIT: Here is an example of markup:
<a href="#" class="show_hide">Video & Music</a>
<div class="slidingDiv">CONTENT HERE</div>
This will work.
jsfiddle – http://jsfiddle.net/ABrunkhorst/vFnqp/1/