el
Scrollbar容器的css选择器或HTML元素。
el信息
- 类型:
- string / HTMLElement
- 默认:
- null
- 举例:
- .swiper-scrollbar
- 启用版本:
- 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/183.html