在 thymeleaf spring boot 中,动态轮播滑块不起作用

2024-04-21

In my spring boot thymeleaf, this following code is slider does not work well.Show the result in image.enter image description here What wrong with in that code. Please Check it out.

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

我认为你不能添加class属性在th:block tag.

<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>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

在 thymeleaf spring boot 中,动态轮播滑块不起作用 的相关文章

随机推荐

  • 在选定的数据范围内创建数据分区,将其输入到 caret::train 函数中以进行交叉验证

    我想为下面的数据框创建折刀数据分区 这些分区将用于caret train 像caret groupKFold 产生 然而 问题是我想将测试点限制为超过 16 天 同时使用这些数据的其余部分作为训练集 df lt data frame Eff
  • 如何用Python为ElasticSearch创建只读客户端?

    我想从 ES 读取数据 但不想意外向其中写入数据 无索引操作 这只是一种安全措施 以便以后修改查询函数的其他人不允许插入数据 当你说你想要只读客户端时 客户端强调您系统中的同一集群可能有其他客户端 然后阻止整个索引为只读将会阻止所有客户端的
  • 在Linux上运行MFC程序

    我有一个相当大的基于 MFC 的程序 我的任务是让它在 Linux 上运行 我已经解释过 这需要将程序重新编写为带有 STL 的直接 C 更多工作 或者重新编写为 Qt C 更少工作 现在我被告知 我需要编写包装器以使每个 MFC 类在 L
  • 如何在 Jupyter 中启用 R 语法突出显示?

    我希望为 Jupyter 编写的 R 代码添加语法突出显示 准确地说 语法高亮超出了数字 文本等已有的语法高亮 我的设置 Packges 康达R 3 2 4 康达版本 4 0 6 Jupyter版本4 1 0 在带有 Chrome 的 Wi
  • 如何更改Exception对象的异常消息?

    所以我捕获了一个异常 Exception 类的实例 我想要做的是更改其异常消息 我可以得到这样的异常消息 e gt getMessage 但如何设置异常消息呢 这是行不通的 e gt setMessage hello 对于几乎所有的情况 您
  • SelectSingleNode 返回 null - 即使有命名空间

    我知道以前曾以类似的方式问过这个问题 但我似乎无法解决这个问题 我有一些 xml
  • 如何允许多个参数为空值

    我在 SSRS 报表生成器中的报表有多个参数 如果不需要选择 我希望所有参数都允许空白值 但是当我尝试运行报告时 第一个参数将允许空 空白值 并且它将提示我输入其余参数 有没有办法解决 Set Allow Blank Value and o
  • 如何遵守自制协议?

    我有一个带有委托属性的类 任何想成为代表的人都必须遵守协议 我这样定义一切 import
  • Android 调用另一个类的方法

    我知道这个问题重复了 但我在互联网上找不到答案 我想调用另一个类的方法 我有Class1和Class2 在第2类中我有这个方法 public void UpdateEmployee some code 我想从Class1调用上面的方法 感谢
  • 理解 scala 中参与者的线程性

    有人告诉我 Scala Actors 实际上从来不会同时执行两个操作 这表明 act 或 React 或 receive 方法本质上是同步的 我知道 act 方法中的长操作可能会导致阻塞问题 并且我假设对消息队列的访问必须以某种方式同步 但
  • Rails 路由中的“mount”指令是什么意思?

    我找不到关键字 mount 的含义轨道布线系统 http api rubyonrails org classes ActionDispatch Routing html 我已经设置了Mercury http jejacks0n github
  • 如何使用multiple属性在Android上上传多个文件?

    I got a
  • 在 python 上使用 TensorRT .engine 文件进行推理

    我使用 Nvidia 的迁移学习工具包 TLT 进行训练 然后使用 tlt converter 将 etlt 模型转换为 engine 文件 我想使用这个 engine 文件在 python 中进行推理 但由于我使用 TLT 进行训练 因此
  • 合并冲突后暂存区中有哪些文件?

    我运行时与 file1 txt 发生冲突git merge b2当前分支是master ls files somcdt file1 txt然后显示 M 100644 4111d50ada6cc03ec6079f226c23efa3142c9
  • 是否可以在 LLVM IR 代码中指定十六进制数?

    例如 error floating point constant invalid for type 3 and i8 0x80 2 从扫描的红外参考手册 http llvm org docs LangRef html simple cons
  • 从 Java 方法返回多个值:为什么没有 n 元组对象?

    为什么没有一个 标准的 Java 认证的 解决方案作为 Java 语言本身的一部分 从 Java 方法返回多个值 而不是开发人员必须使用自己的方法 例如映射 列表 对等 为什么Java不支持n元组对象 特别是考虑可能一起 串联 修改两个对象
  • 防止PHP脚本被淹没

    我想防止我的脚本被淹没 如果用户按 F5 它每次都会执行脚本 我想防止这种情况并允许每 2 秒执行一个脚本 有什么解决方案吗 您可以使用内存缓存来执行此操作 简单的演示脚本 memcache new Memcache memcache gt
  • Typescript 中的 new() 是什么?

    我遇到了new 在官方文件中here https www typescriptlang org docs handbook generics html关于泛型 这是代码上下文 function create
  • javascript - 从输入类型=文件获取文件名和扩展名

    我有一个文件上传输入 当我单击浏览按钮并选择文件时 我希望文件名和扩展名显示在两个输入文本框中 请参阅代码示例 它与扩展名一起正常工作 但文件名还显示了给我 fakepath 警告的路径 我明白为什么 但是有什么好方法可以做到这一点并将文件
  • 在 thymeleaf spring boot 中,动态轮播滑块不起作用

    In my spring boot thymeleaf this following code is slider does not work well Show the result in image What wrong with in