Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要能够对选定的选项卡和它之前的选项卡执行操作。我可以像这样获取所选选项卡的索引:
var selectedIndex = $tabs.tabs('option', 'selected');
所以我想做类似的事情
$leftTab = $tabs.getTabByIndex(selectedIndex - 1);
有什么近似的吗?还是有另一种方法可以做到这一点?
假设$tabs你的标签元素周围是容器div,试试这个:
$tabs
div
$leftTab = $("div", $tabs).eq(selectedIndex - 1);