jquery show/hide/toggle etc.
- by Ray
JQUERY:
$("li h2").click(function() {
$(this).toggleClass("active").siblings().removeClass("active");
$(this).next("div").slideToggle("fast").siblings("div").slideUp("fast");
});
HTML:
<ul>
<li>
<h2>headingA</h2>
<div>contentA</div>
<h2>headingB</h2>
<div>contentB</div>
</li>
</ul>
NOTES:
Bascially I'd want: when click on h2 show the div next to it and hide all others, not only show/hide toggle as well.
thanks!