Bootstrap:如何更改选项卡内容和其他面板

时间:2013-05-31 10:24:02

标签: twitter-bootstrap tabs

我需要为标签和其他面板创建一个带有面板的网格,以获取上下文帮助。

目前我有代码来创建面板和标签,如下所示:

<div class="container-fluid">
    <div class="row-fluid">
        <div class="span8 well">
            <ul class="nav nav-tabs">
                <li class="active"> <a href="#home" data-target="#home" data-toggle="tab">Home</a>
                </li>
                <li><a href="#profile" data-target="#profile" data-toggle="tab">Profile</a>
                </li>
            </ul>
            <div class="tab-content">
                <div class="tab-pane active fade in" id="home">home tab content</div>
                <div class="tab-pane" id="profile">profile tab content</div>
            </div>
        </div>
        <div class="span3 well">
            <div class="tab-content">
                Here should came the contextual help
            </div>
        </div>
    </div>
</div>

强制性的jsFiddle

1 个答案:

答案 0 :(得分:1)

我已经想出了如何做到这一点,我将其留在这里征求意见或帮助有人尝试这样做:

<div class="container-fluid">
    <div class="row-fluid">
        <div class="span8 well">
            <ul class="nav nav-tabs">
                <li class="active"> <a href="#home" data-target="#home, #home_help" data-toggle="tab">Home</a>
                </li>
                <li><a href="#profile" data-target="#profile, #profile_help" data-toggle="tab">Profile</a>
                </li>
            </ul>
            <div class="tab-content">
                <div class="tab-pane active fade in" id="home">home tab content</div>
                <div class="tab-pane" id="profile">profile tab content</div>
            </div>
        </div>
        <div class="span3 well">
            <div class="tab-content">
                <div class="tab-pane active fade in" id="home_help">home_help content</div>
                <div class="tab-pane fade in" id="profile_help">profile_help content</div>
            </div>
        </div>
    </div>
</div>

和jsFiddle:http://jsfiddle.net/AazhZ/