当前位置:网站首页>swiper 轮播图,最后一张图与第一张图无缝衔接
swiper 轮播图,最后一张图与第一张图无缝衔接
2022-07-01 15:09:00 【蹦跶哒的王小哲】
问题描述:
最近用 swiper 做广告轮播图,然后发现当滑动到最后一张图片时,中间的图片会一闪而过,这样影响美观。
问题解决:
增加 loop: true 属性;
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>手机端轮播图</title>
<link rel="stylesheet" href="./css/swiper.min.css">
</head>
<body>
<div class="contenter">
<div class="swiper-container">
<div class="swiper-wrapper" loop="true">
<div class="swiper-slide"><a href="#"><img width="100%" src="./images/banner.jpg" alt=""></a></div>
<div class="swiper-slide"><a href="#"><img width="100%" src="./images/banner2.jpg" alt=""></a></div>
<div class="swiper-slide"><a href="#"><img width="100%" src="./images/banner.jpg" alt=""></a></div>
</div>
<div class="swiper-pagination"></div>
</div>
</div>
<script src="./js/swiper.min.js"></script>
<script>
var mySwiper = new Swiper('.swiper-container', {
loop: true,//最后一张与第一张无缝链接
autoplay:3000,//可选选项,自动滑动时间
pagination: '.swiper-pagination',
paginationClickable: true,
})
</script>
</body>
</html>边栏推荐
- 炎炎夏日,这份安全用气指南请街坊们收好!
- Digital transformation: data visualization enables sales management
- MongoDB第二话 -- MongoDB高可用集群实现
- leetcode:329. Longest increasing path in matrix
- 基于价值量化的需求优先级排序方法
- The first word of JVM -- detailed introduction to JVM and analysis of runtime data area
- TypeScript:const
- The difference between arrow function and ordinary function in JS
- [lock] redis lock handles concurrency atomicity
- k8s部署redis哨兵的实现
猜你喜欢

Wechat official account subscription message Wx open subscribe implementation and pit closure guide

Introduction to MySQL audit plug-in

How to realize clock signal frequency division?

MySQL 服务正在启动 MySQL 服务无法启动解决途径

微服务追踪SQL(支持Isto管控下的gorm查询追踪)

Official announcement: Apache Doris graduated successfully and became the top project of ASF!

MySQL service is starting. MySQL service cannot be started. Solution
![[leetcode] 16. The sum of the nearest three numbers](/img/60/6a68333d6e543c601e6ed586b830d0.png)
[leetcode] 16. The sum of the nearest three numbers

炎炎夏日,这份安全用气指南请街坊们收好!

Task. Run(), Task. Factory. Analysis of behavior inconsistency between startnew() and new task()
随机推荐
Go zero actual combat demo (I)
《QT+PCL第六章》点云配准icp系列3
Tensorflow 2. X realizes iris classification
TypeScript:const
skywalking 6.4 分布式链路跟踪 使用笔记
基于价值量化的需求优先级排序方法
Flink 系例 之 TableAPI & SQL 与 Kafka 消息插入
Rearrangement of overloaded operators
《QT+PCL第六章》点云配准icp系列2
MySQL 服务正在启动 MySQL 服务无法启动解决途径
Wechat official account subscription message Wx open subscribe implementation and pit closure guide
tensorflow2-savedmodel convert to pb(frozen_graph)
Solid basic basic grammar and definition function
QT capture interface is displayed as picture or label
opencv学习笔记四--银行卡号识别
微信网页订阅消息实现
【天线】【3】CST一些快捷键
Official announcement: Apache Doris graduated successfully and became the top project of ASF!
Hidden rules of the workplace that must be understood before 30
项目中字符串判空总结