简体   繁体   English

Bootstrap嵌套选项卡在重新选择之前不会显示

[英]Bootstrap nested tab not displaying until being re-selected

I am designing an admin panel for my application using nested tabs. 我正在使用嵌套选项卡为我的应用程序设计一个管理面板。 Here is a basic diagram of how the tabs are set up. 这是标签设置方式的基本示意图。

  1. Initially Active and Visible 最初活跃且可见

    -1a Initially Active and Visible -1a最初是活动且可见的

    -1b Inactive -1b无效

    -1c Inactive -1c不活跃

  2. Inactive 待用

    -2a Initially Active but NOT Visible -2a最初处于活动状态但不可见

    -2b Inactive -2b无效

    -2c Inactive -2c无效

2a is not visible at first because its parent(2) is not active however 2a does have the tag: 起初2a是不可见的,因为其parent(2)未激活,但是2a确实具有以下标记:

<li class='active'>

When I click on tab 2, tab 2a appears to be active, but the tab-pane is empty. 当我单击选项卡2时,选项卡2a似乎处于活动状态,但选项卡窗格为空。 Looking at the page source shows that there is data in the tab-pane for 2a. 查看页面源代码可以看到,选项卡窗格中有2a的数据。 In order to see it I must click on tab 2b, then click back to tab 2a. 为了查看它,我必须单击选项卡2b,然后单击回到选项卡2a。 My first thought was to remove .active from 2a. 我的第一个想法是从2a中删除.active。 This then requires the user to click on 2a to active it instead of de-activating then re-activating to display the content. 然后,这要求用户单击2a以将其激活,而不是停用然后重新激活以显示内容。 What I want to happen is for 2a to be immediately visible when tab 2 is clicked. 我想让2a在单击选项卡2时立即可见。 Sorry for the long explanation. 很抱歉,冗长的解释。 Below is the code if that is easier for you to sort through. 如果您更容易进行排序,则下面是代码。

I placed the HTML code in this jsfiddle because it was too long to include in the post. 我将HTML代码放在此jsfiddle中,因为它太长了,无法包含在帖子中。

http://jsfiddle.net/vhFFf/ http://jsfiddle.net/vhFFf/

EDIT: 编辑:

Here is a working fiddle that accurately shows the issue I am trying to correct: 这是一个有效的小提琴,可准确显示我要纠正的问题:

http://jsfiddle.net/52VtD/4862/ http://jsfiddle.net/52VtD/4862/

Be sure to drag the Result pane as wide as possible so that the content displays as intended. 确保将“结果”窗格拖动到尽可能宽的位置,以便按预期显示内容。 When you click the "Users" button in the most left menu, the initially active pane content is not displayed. 当您单击最左侧菜单中的“用户”按钮时,不会显示最初处于活动状态的窗格内容。 You must click "add user" or "trash" then click back to "Users" to see that panes content. 您必须单击“添加用户”或“已删除邮件”,然后单击回到“用户”以查看该窗格的内容。

I think you have to manually add the active class to the pane to make it active when you switch to that tab <div class="tab-pane active" id="user"> I updated you FIDDLE 我认为你必须主动类手动添加到面板,使其活跃,当你切换到该标签<div class="tab-pane active" id="user">我更新你FIDDLE

that was the simplest solution I could think of hope it helps. 那是我能想到的最简单的解决方案,希望对您有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM