$(document).ready(function(){ $('.head').click(function(){ $(this).next('.row').stop(true, true).slideToggle(); }); });
.head { font-weight: bold; cursor: pointer; margin:15px;} .row{display: none;}
<div class="head">Panel 1 </div> <div class="row"> <div>Panel 1 sample</div> <div>Panel 1 sample</div> <div>Panel 1 sample</div> </div> <div class="head"> Panel 2</div> <div class="row"> <div>Panel 2 sample</div> <div>Panel 2 sample</div> <div>Panel 2 sample</div> <div class="head"> Panel 2-1</div> <div class="row"> <div>Panel 2-1 sample</div> <div>Panel 2-1 sample</div> <div>Panel 2-1 sample</div> <div class="head"> Panel 2-1-1</div> <div class="row"> <div>Panel 2-1-1 sample</div> <div>Panel 2-1-1 sample</div> <div>Panel 2-1-1 sample</div> </div> </div> </div> <div class="head"> Panel 3</div> <div class="row"> <div>Panel 3 sample</div> <div>Panel 3 sample</div> <div>Panel 3 sample</div> </div>