在百里香弹簧靴中,动态旋转木马滑块不起作用 [英] In thymeleaf spring boot, dynamic carousel slider does not work
问题描述
在我的 spring boot thymeleaf 中,以下代码是滑块无法正常工作.在图像中显示结果.这段代码有什么问题.请检查一下.
<th:block th:each="picture, iterstat : ${package.picture}"><li data-target="#jsaAboutCarousel" th:attr="data-slide-to=${iterstat.index}" th:class="${iterstat.index}== 0 ?'active':''"></li></th:block></ol><!-- 幻灯片包装器--><div class="carousel-inner"><div th:each="picture, iterstat : ${package.picture}"><th:block th:class="${iterstat.index}== 0 ? 'item':'item active'"><img th:src="@{${baseurl}+'/backend/getPackageImagePath/' + ${picture}}" class="img-responsive"/></th:block>
<!-- 左右控件--><a class="left carousel-control" href="#jsaAboutCarousel" data-slide="prev"><span class="glyphicon glyphicon-chevron-left"></span><span class="sr-only">上一个</span></a><a class="right carousel-control" href="#jsaAboutCarousel" data-slide="next"><span class="glyphicon glyphicon-chevron-right"></span><span class="sr-only">下一步</span></a>
我不认为你可以在 th:block
标签中添加 class
属性.
<div th:each="picture, iterstat : ${package.picture}"><th:block th:class="${iterstat.index}== 0 ? 'item':'item active'"><img th:src="@{${baseurl}+'/backend/getPackageImagePath/' + ${picture}}" class="img-responsive"/></th:block>