gpt4 book ai didi

spring-boot - 在 thymeleaf spring boot 中,动态轮播 slider 不起作用

转载 作者:行者123 更新时间:2023-12-04 16:02:28 28 4
gpt4 key购买 nike

在我的 spring boot thymeleaf 中,以下代码是 slider 不能正常工作。在图像中显示结果。 enter image description here该代码有什么问题。请检查一下。

    <ol class="carousel-indicators">

<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>

<!-- Wrapper for slides -->



<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>
</div>

</div>


<!-- Left and right controls -->
<a class="left carousel-control" href="#jsaAboutCarousel" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#jsaAboutCarousel" data-slide="next">
<span class="glyphicon glyphicon-chevron-right"></span>
<span class="sr-only">Next</span>
</a>

</div>

最佳答案

我不认为你可以在 th:block 标签中添加 class 属性。

<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>
</div>
</div>

尝试这样改变。

<div class="carousel-inner">
<div th:each="picture, iterstat : ${package.picture}" th:class="${iterstat.index}== 0 ? 'item':'item active'">
<img th:src="@{${baseurl}+'/backend/getPackageImagePath/' + ${picture}}" class="img-responsive" />
</div>
</div>

关于spring-boot - 在 thymeleaf spring boot 中,动态轮播 slider 不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50126956/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com