Nicolas Rojo
Nicolas Rojo

Reputation: 712

Show all tab content in jQuery UI tabs

How can I show all the panes in an "all" tab using jQuery UI tabs?

Upvotes: 0

Views: 2114

Answers (4)

Martin
Martin

Reputation: 51

for jquery ui tabs 1.12.1:

$("#user-tabs").tabs(
    {activate:
            function(event, ui) {
                if ( "do some checking here if the special show-all tab was selected") {
                    $("div[id^='tabs-pane-']").show();
                }
            }
        }
    )

Upvotes: 0

user3879619
user3879619

Reputation: 1

The following will work.

$("div.ui-tabs-hide").removeClass("ui-tabs-hide");

Upvotes: 0

Nicolas Rojo
Nicolas Rojo

Reputation: 712

I've got a solution. What I did was:

var user_tabs = $("#user-tabs").tabs({
    select: function(event, ui) {
        if (ui.index == 0) {
            $("div[id^=tabs-pane-]").show();
        } else {
            $("div[id^=tabs-pane-]").hide();
            $(ui.panel).show()
        }
    }
});

Upvotes: 1

Mash
Mash

Reputation: 1349

Have you tried to show all the divs in your main tab div ?

function ShowAll(){
  $('div#tabs div').show()
}

It could be a nice and simple solution.

Upvotes: 0

Related Questions