JQUERY UI Accordion start collapsed

后端 未结 7 2000
花落未央
花落未央 2020-12-14 05:10

How can I make the jquery UI accordion start collapsed when the form loads. Is there any javascript code for this?

相关标签:
7条回答
  • 2020-12-14 06:04

    If you are using default jquery accordion it always display first panel content, you can disable it by using active: false attribute.

    jQuery(document).ready(function() {
        jQuery( "#accordion" ).accordion({
          collapsible: true,
          active: false,
        });
    });
    

    but it's default behavior is for all panels will be set to the height of the tallest panel. so, for that you have to add "heightStyle" attribute.

    heightStyle: "content",
    

    so, each panel will be only as tall as its content.

    0 讨论(0)
提交回复
热议问题