Swiper常用于移动端网站的内容触摸滑动
Swiper是纯javascript打造的滑动特效插件,面向手机、平板电脑等移动终端。
Swiper能实现触屏焦点图、触屏Tab切换、触屏轮播图切换等常用效果。
Swiper开源、免费、稳定、使用简单、功能强大,是架构移动终端网站的重要选择!
[详情使用](https://www.swiper.com.cn/)
/*1.首先加载插件,需要用到的文件有
swiper-bundle.min.js和swiper-bundle.min.css文件
不同Swiper版本用到的文件名略有不同。可下载Swiper文件或使用CDN。
*/
<!DOCTYPE html>
<html>
<head><link rel="stylesheet" href="dist/css/swiper-bundle.min.css"><script src="dist/js/swiper-bundle.min.js"></script>
</head>
<body><div class="swiper-container"><div class="swiper-wrapper"><div class="swiper-slide">Slide 1</div><div class="swiper-slide">Slide 2</div><div class="swiper-slide">Slide 3</div></div><div class="swiper-pagination"></div><div class="swiper-button-prev"></div><div class="swiper-button-next"></div><div class="swiper-scrollbar"></div></div>
</body>
</html>
<script> var mySwiper = new Swiper ('.swiper-container', {observer: true,observeParents: true,direction: 'vertical', loop: true, pagination: {el: '.swiper-pagination',},navigation: {nextEl: '.swiper-button-next',prevEl: '.swiper-button-prev',},scrollbar: {el: '.swiper-scrollbar',},}) </script>