click to hide div class after it
by mrjordy
HTML
<div class="toggle">Content</div>
<div class="hidden">Content</div>
<div class="toggle">Content</div>
<div class="hidden">Content</div>
CSS
.toggle {width:398px; height:48px; cursor: pointer; border: 1px solid #000}
.hidden {width:300px; height:75px; background-color:#333333; margin-left:50px; text-indent:25px;}
JavaScript
jQuery(document).ready(function() {
jQuery(".toggle").next(".hidden").hide();
jQuery(".toggle").click(function() {
$('.active').not(this).toggleClass('active').next('.hidden').slideToggle(200);
$(this).toggleClass('active').next().slideToggle(200);
});
});