Zabs
Zabs

Reputation: 14142

jQueryUI accordion - Keep sections open

Can anyone show me how I make the accordion stay open eg if I click 3 sections all 3 remain open?

$(function() {
    $( "#accordion1" ).accordion({
        autoHeight: false
    });
});

Upvotes: 0

Views: 4457

Answers (2)

Fury
Fury

Reputation: 4776

Klaus Byskov Pedersen says the right thing
here is your solution.

$(document).ready(function(){ 
          $('.head').click(function(e){ e.preventDefault();
     $(this).closest('li').find('.content').slideToggle(); 
    }); 
}); 

Demo

Upvotes: 0

Klaus Byskov Pedersen
Klaus Byskov Pedersen

Reputation: 120937

From the jQuery UI documentation:

NOTE: If you want multiple sections open at once, don't use an accordion

An accordion doesn't allow more than one content panel to be open at the same time, and it > takes a lot of effort to do that. If you are looking for a widget that allows more than one > content panel to be open, don't use this. Usually it can be written with a few lines of > jQuery instead, something like this:

Upvotes: 4

Related Questions