最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - jQuery UI Accordion (hiding all by default) - Stack Overflow

programmeradmin4浏览0评论

Hello I am using jQuery UI Accodions

By default, the first accordion is shown and other are hidden. I would like to hide all the accordions by default until the user clicks it.

How do I do that ?

Thank You

Hello I am using jQuery UI Accodions

By default, the first accordion is shown and other are hidden. I would like to hide all the accordions by default until the user clicks it.

How do I do that ?

Thank You

Share Improve this question asked Sep 19, 2010 at 12:36 AtifAtif 10.9k21 gold badges67 silver badges97 bronze badges
Add a ment  | 

4 Answers 4

Reset to default 7

This code should acplish this

$( ".selector" ).accordion({ active: false });

This is the updated code to acplish the appropriate.

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

"Setting active to false will collapse all panels. This requires the collapsible option to be true." http://api.jqueryui./accordion/#option-active

To hide all the accordion's panel by default, you need to set the following 2 options:

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

The active option specifies which panel is currently open. By default its value is 0, i.e the first panel.

The collapsible option specifies whether all the sections can be closed at once. Allows collapsing the active section.

发布评论

评论列表(0)

  1. 暂无评论