In previous versions of jQuery tabs
there was an option to automatically set the height of the tab to that of the tallest tab in the group using:
$('#container').tabs({ fxAutoHeight: true });
However this does not seem to work in jQuery UI 1.5.3
.
Has this option been removed? If so is there another way to get the same functionality?
After reading over the documentation, it seems that option is no longer available. However, it is very easy to replicate this functionality.
Assuming your tabs are arranged horizontally:
The answer by Giannis is correct for getting the tallest height among the tabs, but is missing the code to actually apply that solution. You need to add a way to redisplay the first tab (which will be disappeared by the code) and a way to set the height of each of the content areas.
The example by gabriel gave me the right lead but I could not get it to work exactly like that. When looking at the source code example of the jQuery documentation you see that the HTML code is supposed to look like this:
As I have 3 tabs which have content that is rather static, for me it was enough to set the height of all tabs to the height of the highest one, which is #fragment-1 in my case.
This is the code that does this:
I was just looking for this solution, and setting a min-height is only good if you know how high the min height should be in advance.
Instead, I went into the css and changed the ui-tabs class to add "overflow:auto;" as below
This works for me in FF12...I haven't tried it in others. If this works, you may wish to create a separate class to preserve stock functionality and theming interchangeability etc
BTW - the reason you might need dynamic sizing is if you're loading from Ajax, but not using the tab loader method, but rather another function (their method assumes you content is all coming from one url resource which may not be sufficient depending on how advanced you dynamic population is).
HTH