简体   繁体   English

Bootstrap 3:三重嵌套标签错误

[英]Bootstrap 3: Triple nested tab error

I have a triple nested tab in my page. 我的页面中有一个三重嵌套选项卡。 Whenever I activate a middle tag, it stays activated even when I click out of the first tab onto another tab. 每当我激活中间标签时,即使我将第一个标签单击到另一个标签上,它也会保持激活状态。 Here is an example in a jsfiddle. 这是jsfiddle中的一个例子。

http://jsfiddle.net/jNWMY/2/ http://jsfiddle.net/jNWMY/2/

For example: 例如:

  • Try clicking Acquisition then All Device then Facebook 试着点击Acquisition ,然后All Device ,然后Facebook
  • Click Engagement tab in first row 单击第一行中的“ Engagement选项卡
  • Bottom row does not deactivate 底行不会停用

Second example: 第二个例子:

  • Try clicking Acquisition then All Device then Facebook 试着点击Acquisition ,然后All Device ,然后Facebook
  • Click Desktop tab in second row 单击第二行中的Desktop选项卡
  • Bottom row does not deactivate 底行不会停用
  • The first example provided by you can be solved by enclosing nav-tabs and tab-content under tabbable class. 您提供的第一个示例可以通过在tabbable类下包含nav-tabs和tab-content来解决。 Try like this: 试试这样:

jsfiddle 的jsfiddle

<div id="dashboard_container" style="padding-left:50px; padding-right:50px; padding-bottom:50px; padding-top:10px;">
        <h1> Dashboard </h1>

    <div class="tabbable">
        <ul class="nav nav-tabs" id="dashboard_tabs">
            <li> 
                <a href="#acquisition_tab" data-toggle="tab">
                <b>Acquisition</b> 
                <span style="color:red">(-30%)</span> 
                <br/> 
                Total Installs
            </a>

            </li>
            <li> <a href="#engagement_tab" data-toggle="tab">
                Engagement
            </a>

            </li>
            <li> <a href="#retention_tab" data-toggle="tab">
                Retention
            </a>

            </li>
            <li> <a href="#revenue_tab" data-toggle="tab">
                Revenue
            </a>

            </li>
        </ul>

        <div class="tab-content">
            <div id="acquisition_tab" class="tab-pane">
                <div class="tabbable">
                    <ul class="nav nav-tabs" id="acquisition_tabs">
                        <li> <a href="#all_device_acquisition_tab" data-toggle="tab">
                        <b>All Device</b> 
                        <span style="color:red">(-30%)</span> 
                        <br/> Total Installs
                    </a>

                        </li>
                        <li> <a href="#desktop_acquisition_tab" data-toggle="tab">
                        <b>Desktop</b> 
                        <span style="color:red">(-30%)</span> 
                        <br/> 
                        Total Installs
                    </a>

                        </li>
                        <li> <a href="#mobile_acquisition_tab" data-toggle="tab">
                        <b>Mobile</b> 
                        <span style="color:red">(-30%)</span> 
                        <br/> 
                        Total Installs
                    </a>

                        </li>
                    </ul>

                    <div class="tab-content">
                        <div id="all_device_acquisition_tab" class="tab-pane">
                            <div class="tabbable">
                                <ul class="nav nav-tabs" id="all_device_acquisition_tabs">
                                    <li> <a href="#ad_all_acquisition_tab" data-toggle="tab">
                            <b>All</b> 
                            <span style="color:red">(-30%)</span> 
                            <br/> 
                            Total Installs
                        </a>

                                    </li>
                                    <li> <a href="#ad_gamefuse_acquisition_tab" data-toggle="tab">
                            <b>Gamefuse</b> 
                            <span style="color:red">(-30%)</span> 
                            <br/> 
                            Total Installs
                        </a>

                                    </li>
                                    <li> <a href="#ad_facebook_acquisition_tab" data-toggle="tab">
                            <b>Facebook</b> 
                            <span style="color:red">(-30%)</span> 
                            <br/> Total Installs
                        </a>

                                    </li>
                                    <li> <a href="#ad_kongregate_acquisition_tab" data-toggle="tab">
                            <b>Kongregate</b> 
                            <span style="color:red">(-30%)</span> 
                            <br/> Total Installs
                            </a>

                                    </li>
                                    <li> <a href="#ad_yahoo_acquisition_tab" data-toggle="tab">
                            <b>Yahoo</b> 
                            <span style="color:red">(-30%)</span> 
                            <br/> Total Installs
                        </a>

                                    </li>
                                </ul>
                                <div class="tab-content">
                                    <div id="ad_all_acquisition_tab" class="tab-pane">
                                        <p>all device ALL Acquisition</p>
                                    </div>
                                    <div id="ad_gamefuse_acquisition_tab" class="tab-pane">
                                        <p>all device GAMEFUSE Acquisition</p>
                                    </div>
                                    <div id="ad_facebook_acquisition_tab" class="tab-pane">
                                        <p>all device facebook Acquisition</p>
                                    </div>
                                    <div id="ad_kongregate_acquisition_tab" class="tab-pane">
                                        <p>all device kongregate Acquisition</p>
                                    </div>
                                    <div id="ad_yahoo_acquisition_tab" class="tab-pane">
                                        <p>all device yahoo Acquisition</p>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div id="engagement_tab" class="tab-pane">
                <p>Engagement tab</p>
            </div>
            <div id="retention_tab" class="tab-pane">
                <p>Retention tab</p>
            </div>
            <div id="revenue_tab" class="tab-pane">
                <p>Revenue tab</p>
            </div>
        </div>
    </div>
</div>
  • And for the second mentioned problem you haven't provided tab-content for desktop and mobile tabs 对于第二个提到的问题,您没有为桌面和移动标签提供标签内容

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

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