How can you adjust the height of a jQuery UI accordion?

后端 未结 11 1892
礼貌的吻别
礼貌的吻别 2021-01-31 15:32

In my UI I have an accordion setup like this:

Section 1

...content...
//
11条回答
  •  清酒与你
    2021-01-31 16:11

    autoHeight was deprecated in 1.9, and removed in 1.10.

    Use:

    $('#id').accordion({heightStyle: 'content'});
    

    to auto size your inner div.

    UPDATE:

    I see that this is still quite an active post, so I decided to make sure my answer is still valid. It looks like this may no longer work in jQuery UI 1.11. It notes that the [content] property has been deprecated, and to use [panel] instead. Making the code snippet now look something more like this:

    $('#id').accordion({heightStyle: 'panel'});
    

    I HAVE NOT YET TESTED THIS, JUST FOUND, AND WILL RETURN AND REMOVE THIS COMMENT WHEN I HAVE TIME TO TEST

提交回复
热议问题