I am exploring how to customize the expand/collapse functionality for multiple DIVs on my webpage. Currently, I have implemented a code snippet that toggles an entire class, but I am wondering if there is a way to target the specific element being clicked instead (e.g. self.slideToggle();).
// Setting up Toggle Feature for Expanding / Collapsing Price Tables
$(".slidingDiv").hide();
$(".show_hide").show();
$('.show_hide').click(function(){
$(this).next(".slidingDiv").slideToggle();
return false;
});
});
UPDATE: A sample markup is provided below:
<a href="#" class="show_hide">Video & Music</a>
<div class="slidingDiv">CONTENT HERE</div>