迭代JQuery UI选项卡中的选项卡

时间:2010-08-29 19:19:09

标签: jquery jquery-ui jquery-ui-tabs

我正在尝试将数据加载到选项卡面板(ui.panel),然后通过.tabs(“select”,ui.index)激活相关选项卡。

如何在jQuery UI选项卡中迭代所有ui对象?通过UI Tabs对象的加载方法可用的那些。

1 个答案:

答案 0 :(得分:1)

这就是我实现目标的方式:

            var $tabs = $("#tabContainer").tabs({
            load: function(event, ui){
                $("a.updateTab").live("click", function(){

                    // href for links are replaced by jq tabs with this pattern (pseudocode):
                    // a.href = "#" + a.title.replace(" ", "_")
                    // so we're searching a tab wich content should be reloaded
                    var tabItemId = "#Menu_" + "some text";

                    var index = $(".ui-tabs-panel", $tabs).index($(tabItemId));
                    $tabs.tabs("url", index, this.href);
                    $tabs.tabs("select", index);
                    return false;
                });
            }
        });
相关问题