See the Pen Slides Per View by leesunho70 (@leesunho70) on CodePen.
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://unpkg.com/swiper/css/swiper.css">
<link rel="stylesheet" href="https://unpkg.com/swiper/css/swiper.min.css">
<script src="https://unpkg.com/swiper/js/swiper.js"></script>
<script src="https://unpkg.com/swiper/js/swiper.min.js"></script></head>
</head>
<body>
<style>
html, body {
position: relative;
height: 100%;
width: 100%;
margin: 0;
padding: 0;
}
.swiper-container {
width: 100%;
height: 100%;
}
.swiper-container-v .swiper-wrapper .swiper-slide:nth-child(1) {
height: 50%; background-color:pink;
}
.swiper-container-v .swiper-wrapper .swiper-slide:nth-child(2) {
height: 100%; background-color:#ffffff;
}
.swiper-container-v .swiper-wrapper .swiper-slide:nth-child(3) {
height: 100%; background-color:#eeeeee;
}
.swiper-container-h .swiper-wrapper .swiper-slide:nth-child(1) {
height: 100%;background-color:#eeeeee;
}
.swiper-container-h .swiper-wrapper .swiper-slide:nth-child(2) {
height: 100%;background-color:#ffffff;
}
.swiper-container-h .swiper-wrapper .swiper-slide:nth-child(3) {
height: 100%;background-color:#eeeeee;
}
</style>
</head>
<body>
<div class="swiper-container swiper-container-v">
<div class="swiper-wrapper">
<div class="swiper-slide">V1</div>
<div class="swiper-slide">
<div class="swiper-container swiper-container-h">
<div class="swiper-wrapper">
<div class="swiper-slide">H1</div>
<div class="swiper-slide">H2</div>
<div class="swiper-slide">H3</div>
</div>
<div class="swiper-pagination swiper-pagination-h"></div>
</div>
</div>
<div class="swiper-slide">V3</div>
</div>
</div>
<script>
window.onload = function () {
var swiperV = new Swiper('.swiper-container-v', {
direction: 'vertical',
slidesPerView: 'auto',
pagination: {
// el: '.swiper-pagination-v',
//clickable: true,
},
});
var swiperH = new Swiper('.swiper-container-h', {
slidesPerView: 1,
pagination: {
el: '.swiper-pagination-h',
//clickable: true,
},
});
};
</script>
</body>
</html>