khyati
khyati

Reputation: 15

Is this possible with accordions to keep all sections close untill user clicked on particular section header

Is this possible with accordions to keep all sections close until user click on particular section header.i tried but by default, accordions always keep one section open.

thanks in advance..

Upvotes: 0

Views: 282

Answers (2)

Sowmya
Sowmya

Reputation: 26969

You can try this DEMO

$(document).ready(function () {
  $('#nav > li > a').click(function(){
    if ($(this).attr('class') != 'active'){
      $('#nav li ul').slideUp();
      $(this).next().slideToggle();
      $('#nav li a').removeClass('active');
      $(this).addClass('active');
    }
  });
});​

Upvotes: 1

David Hedlund
David Hedlund

Reputation: 129792

Yes, you may specify active: false in accordion options.

Demo

Upvotes: 3

Related Questions