How do I make a Jquery Accordion collapsed when I'm redirected to my page

StackOverflow https://stackoverflow.com/questions/22865602

  •  27-06-2023
  •  | 
  •  

Вопрос

I've got an accordion on my page and I want to have all 4 panes closed, how would I do this, does it have anything to do with this piece of code?

$(function() {
    $( "#accordion" ).accordion({
        collapsible: true
    });
});

My example: http://jsfiddle.net/wUR6F/

Это было полезно?

Решение

In order for all the panes to be collapsed, you also have to specify false in the active option:

$("#accordion").accordion({
    active: false,
    collapsible: true
});

You will find an updated fiddle here.

Другие советы

The collapsible: true allows the accordion to be collapsed.

To make it start off so all 4 panels are closed you can add active:false

See a Fiddle here

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top