当前位置:网站首页>Swiper系列之轮播图
Swiper系列之轮播图
2022-08-02 11:51:00 【老__L】
1、引入 CSS 文件
<link rel="stylesheet" href="./swiper/swiper-bundle.min.css" />
2、引入 js 文件
<script src="./swiper/swiper-bundle.min.js"></script>
3、页面布局
<!-- Swiper -->
<div class="slider swiper">
<div class="swiper-wrapper">
<div class="swiper-slide">
<img src="./img/slider1.png" alt="" />
</div>
<div class="swiper-slide">
<img src="./img/slider1.png" alt="" />
</div>
<div class="swiper-slide">
<img src="./img/slider1.png" alt="" />
</div>
<div class="swiper-slide">
<img src="./img/slider1.png" alt="" />
</div>
<div class="swiper-slide">
<img src="./img/slider1.png" alt="" />
</div>
<div class="swiper-slide">
<img src="./img/slider1.png" alt="" />
</div>
<div class="swiper-slide">
<img src="./img/slider1.png" alt="" />
</div>
<div class="swiper-slide">
<img src="./img/slider1.png" alt="" />
</div>
</div>
<div class="swiper-pagination"></div>
</div>
4、js 逻辑编写
var swiper = new Swiper(".slider", {
autoplay: {
delay: 1000,
// loop: true,
stopOnLastSlide: false,
disableOnInteraction: false,
observer: true, //开启动态检查器,监测swiper和slide
observeParents: true //监测Swiper 的祖/父元素
},
pagination: {
el: ".swiper-pagination"
}
});
后记
如果你感觉文章不咋地
//(ㄒoㄒ)//,就在评论处留言,作者继续改进;o_O???
如果你觉得该文章有一点点用处,可以给作者点个赞;\\*^o^*//
如果你想要和作者一起进步,可以微信扫描二维码,关注前端老L;~~~///(^v^)\\\~~~
谢谢各位读者们啦(^_^)∠※!!!

边栏推荐
- Likou 977-Squaring of ordered arrays - brute force method & double pointer method
- npm WARN config global `--global`, `--local` are deprecated. Use `--location解决方案
- go源码之sync.Waitgroup
- pyqt5连接MYSQL数据库问题
- Solve the problem of Chinese garbled characters in exporting excel file names
- 当POC遇见RPA:RPA项目顺利实施的关键
- ansible module --yum module
- WPF 实现窗体抖动效果
- Shell编程之条件语句
- Coroutines and Lifecycle in Kotlin
猜你喜欢
随机推荐
Several reasons why applet plugins benefit developers
使用mosquitto过程中的问题解决
ansible module --copy module
【Acunetix-忘记密码】
基于深度学习的裂缝检测技术
Idea 全局搜索(idea如何全局搜索关键字)
Leek 151 - Reverse words in a string
细学常用类,集合类,IO流
受邀出席Rust开发者大会|Rust如何助力量化高频交易?
When not to use () instead of Void in Swift
npm run serve启动报错npm ERR Missing script “serve“
yolo格式(txt)数据集转VOC(xml)
Pytorch 占用cpu资源过多
Likou 704 - binary search
图形处理单元(GPU)的演进
JSP中include指令的功能简介说明
go源码之sync.Waitgroup
CCF论文会议 IEEE 如何查询某个会议期刊的所有文章
微信小程序---组件开发与使用
sqli-labs(less-11)









