Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jquery accordion height

I have two accordion.

Accordion 1 : Router Info(contains gridRouter)

Accordion 2 : UNC Info(contains gridUNC)

If the gridRouter contains 2 records and gridUNC contains 30 records, the accordion 1 takes space for 30 records (not for 2 records)

like image 926
mmk_open Avatar asked Jun 16 '11 08:06

mmk_open


3 Answers

As of jQuery UI 1.10 the 'autoHeight' attribute has been deprecated. To achieve the same effect in the new version use heightStyle: "content"

See an example: http://jqueryui.com/accordion/#no-auto-height

like image 152
Maciej Gurban Avatar answered Nov 06 '22 23:11

Maciej Gurban


you should use

$("#accordion").accordion({ 

heightStyle: "content" 

});

It will set height according to your content. and will not use blank space as height.

like image 29
Tarun Gupta Avatar answered Nov 06 '22 22:11

Tarun Gupta


Try setting the autoHeight property to false. See http://jqueryui.com/demos/accordion/#options.

like image 21
GregL Avatar answered Nov 06 '22 22:11

GregL