Swiper中文论坛
标题:
swiper滚动条scrollbar问题
[打印本页]
作者:
臾凉
时间:
2018-12-10 17:14
标题:
swiper滚动条scrollbar问题
使用scrollbar属性,滚动条的滑块是从中间开始的,不是从最左边开始滑动,
JS代码如下
<script>
var swiper = new Swiper('.swiper-container', {
scrollbar: {
el: '.swiper-scrollbar',
hide: true,
},
});
</script>
复制代码
HTML代码
<div class="swiper-container" style="height: 30%;width: 100%">
<div class="swiper-wrapper" style="height: 100%;width: 100%">
<div class="swiper-slide"><img src="img/n.png"></div>
<div class="swiper-slide"><img src="img/n.png"></div>
<div class="swiper-slide"><img src="img/n.png"></div>
<div class="swiper-slide"><img src="img/n.png"></div>
<div class="swiper-slide"><img src="img/n.png"></div>
<div class="swiper-slide"><img src="img/n.png"></div>
<div class="swiper-slide"><img src="img/n.png"></div>
<div class="swiper-slide"><img src="img/n.png"></div>
<div class="swiper-slide"><img src="img/n.png"></div>
<div class="swiper-slide"><img src="img/n.png"></div>
</div>
<div class="swiper-scrollbar"></div>
</div>
复制代码
求助!!!
作者:
pandasLin
时间:
2020-11-5 13:55
请问解决了吗?我也遇到了这个问题。
欢迎光临 Swiper中文论坛 (http://bbs.swiper.com.cn/)
Powered by Discuz! X3.2