I have an web application with a dynamic number of tabs ranging between 2 to 20.
I’m currently using Jquery UI’s tab plugin, but finding that it’s behaviour is less then Ideal (i.e. around 12 tabs, when it wraps, the second line of tabs move with the tab selection and sometimes jump across 3 lines instead of two.
This is a two-fold question, first off does anyone have any idea how I could stop the second row of tabs jumping around when the selection changes.
Alternatively does anyone know of a tab plugin for jQuery that handles multiple lines of tabs well (if I can’t find a resolution I might end up using ExtJS or something similar, but was trying to keep this application fairly light-weight).
Answer
After further investigation it turns out this was being caused by the Jquery UI theme I was using, this was the problematic style:
.ui-tabs .ui-tabs-nav li.ui-tabs-selected { padding-bottom: .1em; border-bottom: 0; }
I just removed the padding-bottom: .1em and it resolve the issue (the clue was that the second row of elements were moving along with the selection changing).
you don’t really need an extension at all. Just use floating LI’s with an unstyled UL. The LI’s should wrap properly. Usually a good idea to ensure words in the same tab do not wrap by replacing ‘ ‘ with ‘ ‘.
My custom tab control is built dynamically with ASP.Net, but the tabbing and the hide/show functionality is all jQuery.
Basic CSS