Swiper thymeleaf
html页面:
<div class="swiper-container swiper_tjzt">
<div class="swiper-wrapper">
<div class="swiper-slide" th:each="i : ${#numbers.sequence( 1,((#lists.size(tagListInfos)%8==0)?(#lists.size(tagListInfos)/8):(#lists.size(tagListInfos)/8+1)))}">
<div class="weui-grids">
<th:block th:each="tagInfos,iterStat:${tagListInfos}" >
<th:block th:if="${iterStat.count<=8*i and iterStat.count>=(8*(i-1)+1)}">
<a class="weui-grid" th:onclick="'javascript:listBybq(\''+${tagInfos.id}+'\',\''+1+'\');'">
<div class="weui-grid__icon">
<img th:src="@{${tagInfos.bqurl}}" alt="" />
</div>
<p class="weui-grid__label" th:text="${tagInfos.bqname}"></p>
</a>
</th:block>
</th:block>
</div>
</div>
</div>
<div class="swiper-pagination pagination_tjzt"></div>
</div>
js部分:
var mySwiper = new Swiper('.swiper_tjzt', {
pagination: '.pagination_tjzt',
// paginationClickable: true,
spaceBetween: 30,
});
后端返回json数据实例:
{ "code": "0","msg": "请求成功","data": [{"id":"","bqname": "亲子","bqurl": "图片路径"
},
{"id":"","bqname": "自驾","bqurl": "图片路径"},{"id":"","bqname": "蜜月","bqurl": "图片路径"},{"id":"","bqname": "古镇","bqurl": "图片路径"},{"id":"","bqname": "爸妈游","bqurl": "图片路径"},{"id":"","bqname": "山水游","bqurl": "图片路径"},{"id":"","bqname": "健康养生","bqurl": "图片路径"}]}
java后台封装:
model.addAttribute("tagListInfos",service.获取接口方法返回的json数据());
最终实现效果为:
thymeleaf 学习文档
http://www.open-open.com/lib/view/open1451625468230.html
Swiper thymeleaf的更多相关文章
- spring boot(四):thymeleaf使用详解
在上篇文章springboot(二):web综合开发中简单介绍了一下thymeleaf,这篇文章将更加全面详细的介绍thymeleaf的使用.thymeleaf 是新一代的模板引擎,在spring4. ...
- Thymeleaf
1.在html顶部添加 <html xmlns:th="http://www.thymeleaf.org"> 2.url表达式 @{...} <link rel= ...
- swiper插件 纵向内容超出一屏解决办法
1.css .swiper-slide { overflow: auto; } 2.js var swiper = new Swiper('.swiper-container', { directio ...
- swiper的初步使用
1.引入文件,顺序引入(此处基于jquery,且版本至少1.7以上) <link rel="stylesheet" href="path/to/swiper-3.4 ...
- Thymeleaf 模板的使用
Thymeleaf是现代化服务器端的Java模板引擎,不同与JSP和FreeMarker,Thymeleaf的语法更加接近HTML,并且也有不错的扩展性.详细资料可以浏览官网.本文主要介绍Thymel ...
- 关于移动端swiper的2种样式重置
手机查看效果地址:猛戳 ,PC端查看可以缩放浏览器窗口看效果~~ 思路:主要考虑选择器优先级大于默认就可以随意撸码 注意:该demo里用的mobile-adaptive.js是让页面以rem自适应,也 ...
- ReactNative新手学习之路04 组件化开发轮播图swiper支持安卓和IOS
react native 新手之路04 组件化开发轮播图swiper支持安卓和IOS npm install react-native-carousel --save git 地址Properties ...
- swiper框架,实现轮播图等滑动效果
http://www.swiper.com.cn/ 做个记录而已,这个没什么好说的,对于需要手机端开发实现触摸等方式可以看看.
- vert.x学习(三),Web开发之Thymeleaf模板的使用
在vert.x中使用Thymeleaf模板,需要引入vertx-web-templ-thymeleaf依赖.pom.xml文件如下 <?xml version="1.0" e ...
随机推荐
- grpc nodejs tools 安装问题
grpc nodejs 应用安装提示错误: stack Error: EPERM: operation not permitted, utime '/usr/local/lib/node_modul ...
- gradle asciidoc 使用
备注: 次文档参考github 例子 1.环境准备 node npm (yarn) java KindleGen 备注: 具体的安装可以参考网上相关文档,KindleGen 下载地址:htt ...
- 谷歌被墙后,能够搜索的ip地址
版权声明:本文为博主原创文章,未经博主同意不得转载. https://blog.csdn.net/langresser/article/details/32339707 http://209.116. ...
- c++中重载,重写,覆盖
1.重载 重载从overload翻译过来,是指同一可访问区内被声明的几个具有不同参数列表(参数的类型,个数,顺序不同)的同名函数,根据参数列表确定调用哪个函数,重载不关心函数返回类型. 相同的范围(在 ...
- luvcview,使用mplayer查看摄像头和luvcview保存YUV图像视频的播放(转)
luvcview,使用mplayer查看摄像头和luvcview保存YUV图像视频的播放 在mplayer中查看摄像头,可使用如下命令:mplayer tv:// -tv driver=v4l2:in ...
- 本地tomcat调用远程接口报错:java.lang.reflect.InvocationTargetException
今天碰到一个奇怪的问题,本地Eclipse起了一个tomcat通过http去调一个外部接口,结果竟然报了一个反射的异常,先看下完整日志: , :: 下午 org.apache.catalina.sta ...
- ubuntu :安装好了搜狗输入法但是没法用
用 im-config 命令打开一个配置器窗口 默认是ibus,需要修改为 fcitx 重启 ubuntu 系统就可以了.
- java代码---------比较随机数的大小---我搞不懂啊
总结:不习惯你在或不在的时候,赶紧走吧 package com.mmm; import java.util.Random; public class wW { public static double ...
- CodeForces - 963B Destruction of a Tree (dfs+思维题)
B. Destruction of a Tree time limit per test 1 second memory limit per test 256 megabytes input stan ...
- Linux下压缩与解压
转自:http://www.mike.org.cn/blog/index.php?load=read&id=218###pp=0 [在解压或压缩的时候,一般还使用-v选项来现实正在处理的文件信 ...