我使用弹簧靴,百里香和自行车。这是我在百里香的部分代码
<ul class="nav navbar-nav">
<li th:class="${page == 'home' ? 'active' : ''}"><a
th:href="@{/}"><span class="glyphicon glyphicon-home"></span>
Home</a></li>
<li class="dropdown"><a href="#" class="dropdown-toggle"
data-toggle="dropdown" role="button" aria-haspopup="true"
aria-expanded="false">Dropdown <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="#">Action</a></li>
<li><a href="#">Another action</a></li>
<li><a href="#">Something else here</a></li>
<li role="separator" class="divider"></li>
<li class="dropdown-header">Nav header</li>
<li><a href="#">Separated link</a></li>
<li><a href="#">One more separated link</a></li>
</ul></li>
</ul>
此代码包含css和javascript文件
<link rel="stylesheet" th:href="@{/bootstrap/css/bootstrap.min.css}" />
<script type="text/javascript" th:src="@{/jquery/jquery-2.1.3.min.js}"></script>
<script>
$(document).ready(function () {
$('.dropdown-toggle').dropdown();
});
</script>
<script type="text/javascript"
th:src="@{/bootstrap/js/bootstrap.min.js}"></script>
为什么我的百里香的下拉切换不起作用?