开发者

Iterate through tabs in JQuery UI Tabs

开发者 https://www.devze.com 2023-01-13 08:10 出处:网络
I\'m trying to 开发者_运维百科load data to a tab panel (ui.panel) and then activate related tab through .tabs(\"select\", ui.index).

I'm trying to 开发者_运维百科load data to a tab panel (ui.panel) and then activate related tab through .tabs("select", ui.index).

How can I iterate through all ui objects in jQuery UI Tabs? Those that are available through load method of UI Tabs object.


This is how I achieved my goal:

            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;
                });
            }
        });
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号