使用jQuery ui 1.10.3在jQuery 1.9.1中选择和加载选项卡

时间:2013-08-02 06:16:12

标签: jquery ajax

如何使用jQuery选项卡以编程方式选择给定选项卡

例如:页面加载时,选择标签1(从零开始)

3 个答案:

答案 0 :(得分:0)

得到答案here

您初始化标签,然后选择所需标签。

$(function() { 
  $( "#TabIdentifierIdInYourHTML" ).tabs(); 
  $( "#TabIdentifierIdInYourHTML" ).tabs( "option", "active", 2 ); 
});

答案 1 :(得分:0)

试试这个:

$('#tabs').tabs({
    select: function(event, ui) { // select event
        $(ui.tab); // the tab selected
        ui.index; // zero-based index
    },
    show: function(event, ui) { // show event
        $(ui.tab); // the tab shown
        ui.index; // zero-based index
    }
});  

Found from Here

答案 2 :(得分:0)

你可以简单地做到这一点

$("#id").tabs( "select" , 1);