swiper pagination bullet 갯수 줄이는 방법?
본문
3개 정도만 필요한데 8개 정도가 계속 나와있어요ㅠㅠ
html에는 swiper-slide 3개만 넣어뒀고
<div class="swiper slide2">
<div class="swiper-wrapper slide2_in">
<div class="swiper-slide sc_slide"><img src="../images/main/scroll_section_bg.png" alt="">
</div>
<div class="swiper-slide sc_slide"><img src="../images/main/scroll_section_bg2.png" alt=""></div>
<div class="swiper-slide sc_slide"><img src="../images/main/scroll_section_bg.png" alt=""></div>
</div>
<div class="swiper-pagination sc_page"></div>
<div class="scroll-stop"></div>
<div class="swiper-button-next scroll-next"></div>
<div class="swiper-button-prev scroll-prev"></div>
</div>
script에 dynamicMainBullets: 3 을 붙여봐도 그대로입니다....
<script>
var swiper2 = new Swiper('.slide2', {
loop: 'true',
/*autoplay: {
delay: 3000,
disableOnInteraction: false,
},*/
pagination: {
el: '.swiper-pagination',
type: 'bullets',
clickable: true,
dynamicBullets: false,
dynamicMainBullets: 3,
},
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
},
});
$('.start').on('click', function () {
swiper2.autoplay.start();
return false;
})
$('.scroll-stop').on('click', function () {
swiper2.autoplay.stop();
return false;
});
</script>
답변을 작성하시기 전에 로그인 해주세요.