【问题标题】:jQuery UI Tab, Active TabjQuery UI 选项卡,活动选项卡
【发布时间】:2012-03-15 07:57:19
【问题描述】:

我不知道如何从后面的代码访问活动标签?因此,我将页面重定向到活动选项卡。我只想知道活动标签索引{1 or 2 or 3}如何获取?

【问题讨论】:

    标签: c# jquery asp.net jquery-ui


    【解决方案1】:

    直接出Documentation

     $('#example').bind('tabsselect', function(event, ui) {
       ui.tab // anchor element of the selected (clicked) tab
       ui.panel // element, that contains the contents of the selected (clicked) tab
       ui.index // zero-based index of the selected (clicked) tab
     });
    

    所以你想得到 ui.index

    【讨论】:

    • function SetTab(index) { $(function () { $('#tabs').tabs('select', index); void (0); }); }
    • 页面加载,我称之为 --> this.InsertJScript(string.Format("SetTab('{0}')", 2));
    • 它正在工作,但我想获得活动索引而不是“2”@Ohgodwhy
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-09-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-01-09
    相关资源
    最近更新 更多