# **滚动条**
```
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>
```
#
```
<script>
window.onload = function(){
var swiper = new Swiper('.swiper-container',{
//如果需要分页器
pagination: {
el: '.swiper-pagination',
},
//如果需要按钮
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
},
// 如果需要滚动条
scrollbar: {
el: '.swiper-scrollbar',
},
});
}
</script>
```
- Swiper
- 01-Swiper简介
- 02-Swiper初体验
- 03-分页器
- 04-前进后退按钮,上一张下一张切换
- 05-滚动条
- 06-自动播放
- 07-无缝轮播
- 08-键盘控制
- 09-鼠标滚轮
- 10-切换效果
- 01-effects
- 02-fadeEffect-淡入淡出
- 03-cubeEffect-一般用于广告
- 04-coverflowEffect相册作品展示
- 05-flipEffect-旋转门
- 11-拓展
- 12-Swiper+Animate.css
- 13-视差拓展
- 14-virtual
- 15-图片懒加载
- 01-loadPrevNext
- 02-loadPrevNextAmount
- 03-loadOnTransitionStart
- 04-elementClass
- 16-3d