我正在使用 jquery ui 选项卡,它运行良好。这是 jquery-ui 选项卡的代码
$(function() {
$( "#tabs" ).tabs();
});
突然我遇到了一个场景,我必须找到当前活动选项卡的索引。所以我浏览了Api 文档并找到了下面的代码。
Get or set the active option, after initialization:
// getter
var active = $( ".selector" ).tabs( "option", "active" );
// setter
$( ".selector" ).tabs( "option", "active", 1 );
什么是“.selector”,我如何获取活动选项卡活动选项卡的当前索引?