开发者

jqueryui showing hidden tab content on this tab

开发者 https://www.devze.com 2022-12-10 03:00 出处:网络
I have an iframe in a tab with a hidden element, and I want to show the element when the tab is opened.

I have an iframe in a tab with a hidden element, and I want to show the element when the tab is opened.

This element (same class) is also under all the tabs, but I only want the element under the current tab to be shown.

Here's my non working attempt at it:

$("#tabs").tabs({
    collapsi开发者_如何学JAVAble: true,
    show: function(event, ui) { 
        ui.find("iframe").contents().find("#hidden").show();
    }
});

Corrections would be appreciated, thanks.


I think you want to use ui.panel instead of ui. The panel attribute on the ui parameter will be the current panel (tab) being shown.

$("#tabs").tabs({
        collapsible: true,
        show: function(event, ui) { 
                ui.panel.find("iframe").contents().find("#hidden").show();
        }
});
0

精彩评论

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