<div class="swiper-container">
<!-- Additional required wrapper -->
<div class="swiper-wrapper">
<!-- Slides -->
<div class="swiper-slide">Slide 1</div>
<div class="swiper-slide">Slide 2</div>
<div class="swiper-slide">Slide 3</div>
...
</div>
<!-- If we need pagination -->
<div class="swiper-pagination"></div>
<!-- If we need navigation buttons -->
<div class="swiper-button-prev"></div>
<div class="swiper-button-next"></div>
<!-- If we need scrollbar -->
<div class="swiper-scrollbar"></div>
</div>
var mySwiper = new Swiper('.swiper-container', {
// Optional parameters
direction: 'vertical' 方向垂直
loop: true, 是否是無縫輪播
// If we need pagination
pagination: {
el: '.swiper-pagination', 是否需要分頁器押蚤,就是小點(diǎn)
},
// Navigation arrows
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev', 是否需要箭頭
},
// And if we need scrollbar
scrollbar: {
el: '.swiper-scrollbar',是否需要滾動條
},
})