Last active
May 1, 2022 12:49
-
-
Save aau8/283ee206919298e8aa2df240992ba11c to your computer and use it in GitHub Desktop.
SwiperJS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link rel="stylesheet" href="https://unpkg.com/swiper/swiper-bundle.min.css" /> | |
<script src="https://unpkg.com/swiper/swiper-bundle.min.js"></script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="swiper-container"> | |
<div class="swiper-wrapper"> | |
<div class="swiper-slide"></div> | |
<div class="swiper-slide"></div> | |
<div class="swiper-slide"></div> | |
</div> | |
<div class="swiper-pagination"></div> | |
<div class="swiper__arrow"> | |
<div class="swiper__arrow-next"></div> | |
<div class="swiper__arrow-prev"></div> | |
</div> | |
<div class="swiper-scrollbar"></div> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const swiper = new Swiper(".swiper-container", { | |
slidesPerView: 1, | |
spaceBetween: 0, | |
loop: true, | |
freeMode: true, | |
breakpoints: { | |
1200: { | |
}, | |
700: { | |
}, | |
400: { | |
}, | |
}, | |
pagination: { | |
el: ".swiper-pagination", | |
}, | |
navigation: { | |
nextEl: ".swiper__arrow-next", | |
prevEl: ".swiper__arrow-prev", | |
}, | |
scrollbar: { | |
el: ".swiper-scrollbar", | |
}, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment