<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/swiper/swiper-bundle.min.css" />
<script src="https://cdn.jsdelivr.net/npm/swiper/swiper-bundle.min.js"></script>
<div class="swiper mySwiper">
<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 class="swiper-slide">Slide 4</div>
<div class="swiper-slide">Slide 5</div>
<div class="swiper-slide">Slide 6</div>
<div class="swiper-slide">Slide 7</div>
<div class="swiper-slide">Slide 8</div>
<div class="swiper-slide">Slide 9</div>
</div>
</div>
<div class="swiper mySwiper swiper-h">
<div class="swiper-wrapper">
<div class="swiper-slide">Horizontal Slide 1</div>
<div class="swiper-slide">
<div class="swiper mySwiper2 swiper-v">
<div class="swiper-wrapper">
<div class="swiper-slide">Vertical Slide 1</div>
<div class="swiper-slide">Vertical Slide 2</div>
<div class="swiper-slide">Vertical Slide 3</div>
<div class="swiper-slide">Vertical Slide 4</div>
<div class="swiper-slide">Vertical Slide 5</div>
</div>
<div class="swiper-pagination"></div>
</div>
</div>
<div class="swiper-slide">Horizontal Slide 3</div>
<div class="swiper-slide">Horizontal Slide 4</div>
</div>
<div class="swiper-pagination"></div>
</div>
<style>
html,body {
position: relative;
height: 100%;
}
body {
background: #eee;
font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
font-size: 14px;
color: #000;
margin: 0;
padding: 0;
}
.swiper {
width: 100%;
height: 100%;
}
.swiper-slide {
text-align: center;
font-size: 18px;
background: #fff;
display: -webkit-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-webkit-box-pack: center;
-ms-flex-pack: center;
-webkit-justify-content: center;
justify-content: center;
-webkit-box-align: center;
-ms-flex-align: center;
-webkit-align-items: center;
align-items: center;
}
.swiper-slide img {
display: block;
width: 100%;
height: 100%;
object-fit: cover;
}
</style>
<script>
let renBullet = ['no1','no2','no3'];
let swiper = new Swiper(".mySwiper", {
direction: "vertical",
slidesPerView: 3,
slidesPerView: "auto",
spaceBetween: 30,
centeredSlides: true,
slidesPerGroup: 3,
loopFillGroupWithBlank: true,
loop: true,
effect: "fade",
freeMode : false,
a11y : false,
autoHeight : true,
autoplay: {
delay: 2500,
disableOnInteraction: false,
},
navigation: {
nextEl: ".swiper-button-next",
prevEl: ".swiper-button-prev",
},
pagination: {
el: ".swiper-pagination",
dynamicBullets: true,
type: "progressbar",
type: "fraction",
renderBullet: function (index, className) {
return '<div class="' + className + '"><span>' + (bullet[index]) + '</span></div>';
}
},
scrollbar: {
el: ".swiper-scrollbar",
hide: true,
},
breakpoints: {
1000: {
slidesPerView: 2,
spaceBetween: 20
}
}
});
var swiper = new Swiper(".swiper-h", {
spaceBetween: 50,
pagination: {
el: ".swiper-pagination",
clickable: true,
},
});
var swiper2 = new Swiper(".swiper-v", {
direction: "vertical",
spaceBetween: 50,
pagination: {
el: ".swiper-pagination",
clickable: true,
},
});
</script>