I have two tabs and configured usign jQuery UI.
ul class=\"tabs\"
li tabone
li tabtwo
ul
dynamically from C# code behind I will hide
It may have side effects if there are other listeners, and it doesn't feel as nice as interacting through the plugins API -- but it gives a less verbose code if you just "click" the tab, rather than count it's index and set it active afterwards, and it's pretty intuitive what's going on. Also it wont fail if the ui-guys decide to rename the option again.
$('#tabs').tabs();
$('#tabs a[href="#tabtwo"]').click();
It's intriguing, though, that the ui tabs code has a meta-function (_getIndex
) with the comment:
"meta-function to give users option to provide a href string instead of a numerical index"
but does not use it when setting the active option, only when calling enable, disable and load.