scrollbar
为Swiper增加滚动条。
scrollbar信息
- 类型:
- object
- 启用版本:
- 4.0.0
效果演示
使用方法示例
从Swiper7开始,容器默认类名由'.swiper-container'变更为'.swiper'。
<div class="swiper">
<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-scrollbar"></div>
</div>
<script type="text/javascript">
var mySwiper = new Swiper('.swiper',{
scrollbar: {
el: '.swiper-scrollbar',
},
});
</script>
转载原创文章请注明:文章转载自:Swiper中文网 [https://www.swiper.com.cn]
本文地址:https://www.swiper.com.cn/api/scrollbar/369.html