Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery UI accordion with autoHeight=true has unnecessary scrollbar on non-default panes

Tags:

I am having trouble with jQuery accordion. When I create a content pane where the non-default pane has more content than default pane, and autoHeight is true, this provides nice animations when switching panes, but the non-default pane gets a scrollbar which I don't want.

You can see this in action by going to http://jqueryui.com/themeroller/, switching to a theme like "Blitzer" or "Humanity", and then opening Section 3 of the example accordion. Happens to me with Safari 3.2.1 and Firefox 3.0.8.

If you switch to autoHeight=false, then this does not happen and all content panes have the correct height, but the content pane is only rendered at the end of the animation and looks strange, so I had to turn off animations to avoid this strangeness.

Either I am misreading something, or this is a bug in jQuery UI accordion. Please help me figure out which of the two it is (or maybe both).

like image 211
Jaanus Avatar asked Apr 07 '09 19:04

Jaanus


2 Answers

I tried several different things. autoHeight: false by itself did not work. This is what finally worked for me:

$( "#accordion" ).accordion({             heightStyle: "content",             autoHeight: false,         clearStyle: true,            }); 

I'm using this in a SharePoint content editor webpart with a fixed width, which added to the height issue when adding content to the accordion widget.

like image 106
user2170518 Avatar answered Sep 23 '22 13:09

user2170518


using this combo options works for me, 1.current version of jquery/ui

$( '#x' ).accordion({     autoHeight: false,     clearStyle: true });      
like image 42
n3rfd Avatar answered Sep 21 '22 13:09

n3rfd