jquerytools/jquerytools — Issue #581: Select tab using class attribute
Author: Alex-Sh
Created: 2011-12-06 13:09:11+00:00
State: open

At this moment only way i found to select default tab is `initialIndex` property.
When output html, it's more intuitive and useful to use anchor 'class = "current"' attribute to select initial tab, without js code. It doesn't work now, initial tab is always first.

Small snippet how to solve this, but I think this future must be out of the box.

```javascript
$(".tabs").each(function (index) {
//get index if tab selected by 'current' class
var initialIndex = $(this).find('li:has(a.current)').index();
//if no class="current" was set index is -1
initialIndex = initialIndex < 0 ? 0 : initialIndex;
//init tabs using found index
$(this).tabs(".tab-panes > div", {initialIndex: initialIndex});
});
```