我正在尝试使用内容创建标签。这是HTML代码。当我第一次加载页面时,主选项卡处于活动状态,接下来当我单击名称时,没有任何操作发生,内容面板也不会打开。
<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="ID=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
</head>
<body>
<div class="panel">
<div class="panel-body">
<ul class="nav nav-tabs nav-tabs-flat nav-justified">
<li class="active"><a th:href="@{#flatmain}" data-toggle="tab">Main</a></li>
<li><a th:href="@{#flatnames}" data-toggle="tab">Names</a></li>
</ul>
<div id="myTabContent" class="tab-content">
<!-- flat-main -->
<div class="tab-pane fade active in" id="flatmain">
<div class="row" style="padding: 1px;">
<div class="form-group">
<label class="control-label col-md-2">Main</label>
<div class="col-md-2">
<input class="form-control" id="disabledMain" type="text" placeholder="Main Value" disabled="disabled" />
</div>
</div>
</div>
</div>
<!-- flat-names -->
<div class="tab-pane fade" id="flatnames">
<div class="row" style="padding: 11px;">
<div class="form-group">
<label class="control-label col-md-2">Full Name</label>
<div class="col-md-2">
<input class="form-control" id="disabledScac" type="text" placeholder="26 Character Value" disabled="disabled" />
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="http://code.jquery.com/jquery-1.12.4.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.16.0/jquery.validate.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.js"></script>
</body>
</html>
我需要使用bootstrap和thymeleaf在标签之间切换。我的标签名称是静态的,它们始终保持相同。只有内容面板需要更改。