使用bootstrap刷新时保持标签打开

时间:2017-07-13 13:56:05

标签: angularjs twitter-bootstrap-3

我在每个标签中都有不同的html页面,如果可能的话,即使在使用bootstrap刷新后我也希望活动标签处于活动状态

<div>
<ul class="nav nav-tabs">
    <li class="active"><a data-toggle="tab" href="#TypeSettings">Type</a></li>
    <li><a data-toggle="tab" href="#EvidenceSettings">Evidence</a></li>
    <li><a data-toggle="tab" href="#OverallTypeSettings">Overall Type</a></li>
</ul>

<div class="tab-content">
    <div id="TypeSettings" class="tab-pane fade in active">
        <div ng-include src="'Templates/AdminSettings/TypeSettings.html'"></div>
    </div>
    <div id="EvidenceSettings" class="tab-pane fade">
        <div ng-include src="'Templates/AdminSettings/EvidenceSettings.html'"></div>
    </div>
    <div id="OverallTypeSettings" class="tab-pane fade">
        <div ng-include src="'Templates/AdminSettings/OverallTypeSettings.html'"></div>
    </div>
</div>   

1 个答案:

答案 0 :(得分:0)

如果您想记住用户最后打开的标签页,那么您需要添加一些JS逻辑。例如,您可以将用户上次打开的选项卡存储在cookie中。