I want to be able to use images of any dimensions in my slider which have a big centered image and not-active slides are like thumbnails.
If you look at this you will understand what I want.
var mySwiper = new Swiper(".swiper-container", {
spaceBetween: 20,
autoHeight:false,
slidesPerView: 9,
centeredSlides: true,
roundLengths: false,
loop: true,
autoplay:true,
navigation: {
nextEl: ".swiper-button-next",
prevEl: ".swiper-button-prev"
}
});
.swiperTitle{text-align:center; margin-block:3rem; font-size:2rem;}
.swiper-container {
width:80vw;
margin-top:3rem;
}
.swiper-container .swiper-wrapper{align-items: flex-end !important;}
.swiper-container .swiper-wrapper .swiper-slide {
width:100px;
}
.swiper-container .swiper-wrapper .swiper-slide img{
/* max-width:100%; */
display: block;
width: 100%;
height: 100%;
object-fit: cover;
}
.swiper-slide.swiper-slide-active {
width:auto;
}
.swiper-slide.swiper-slide-active img{
height:400px !important;
width:auto;
}
.swiper-slide.swiper-slide-next {
}
.swiper-slide.swiper-slide-next img{
}
.swiper-slide.swiper-slide-prev {
}
.swiper-slide.swiper-slide-prev img{
}
.swiper-slide.swiper-slide-active {
width: auto !important;
}
<link href="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css" rel="stylesheet"/>
<script src="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="swiperTitle "><h1>I'm Center</h1></div>
<div class="swiper-container ">
<!-- Additional required wrapper -->
<div class="swiper-wrapper">
<!-- Slides -->
<div class="swiper-slide"><img src="https://res.cloudinary.com/dmgwjncsj/image/upload/v1699846190/slides/gm1aj021pqkvgwxmqh2m.webp">
</div>
<div class="swiper-slide"><img src="https://res.cloudinary.com/dmgwjncsj/image/upload/v1699846167/slides/hrxfcjedxuqjxu1vlmnk.webp">
</div>
<div class="swiper-slide"><img src="https://res.cloudinary.com/dmgwjncsj/image/upload/v1699846133/slides/cpvj6m4vskamatcb6cyx.webp">
</div>
<div class="swiper-slide"><img src="https://res.cloudinary.com/dmgwjncsj/image/upload/v1699846133/slides/krypp2ay6jfy3s7cacxz.webp">
</div>
<div class="swiper-slide"><img src="https://res.cloudinary.com/dmgwjncsj/image/upload/v1699846133/slides/x6wdikxysfxnhuxbuq6x.webp">
</div>
<div class="swiper-slide"><img src="https://res.cloudinary.com/dmgwjncsj/image/upload/v1699846132/slides/womfztcdbqm7cktnrgw6.webp">
</div>
<div class="swiper-slide"><img src="https://res.cloudinary.com/dmgwjncsj/image/upload/v1699846166/slides/aned0mhlxw6oejphkxhr.webp">
</div>
<div class="swiper-slide"><img src="https://res.cloudinary.com/dmgwjncsj/image/upload/v1699846132/slides/vh3xdynitltekz5oaxht.webp">
</div>
<div class="swiper-slide"><img src="https://res.cloudinary.com/dmgwjncsj/image/upload/v1699350937/slide6_kvs1ak.webp">
</div>
<div class="swiper-slide"><img src="https://res.cloudinary.com/dmgwjncsj/image/upload/v1699350948/slide2_fnns1s.webp">
</div>
<div class="swiper-slide"><img src="https://res.cloudinary.com/dmgwjncsj/image/upload/v1699350937/slide4_lmx2jc.webp">
</div>
<div class="swiper-slide"><img src="https://res.cloudinary.com/dmgwjncsj/image/upload/v1699350952/slide8_im3qdf.webp">
</div>
<div class="swiper-slide"><img src="https://res.cloudinary.com/dmgwjncsj/image/upload/v1699350937/slide4_lmx2jc.webp">
</div>
<div class="swiper-slide"><img src="https://res.cloudinary.com/dmgwjncsj/image/upload/v1699350937/slide4_lmx2jc.webp">
</div>
<div class="swiper-slide"><img src="https://res.cloudinary.com/dmgwjncsj/image/upload/v1699846166/slides/mumlvyxkrallvxc90j3i.webp">
</div>
</div>
<!-- If we need navigation buttons -->
<div class="swiper-button-prev"></div>
<div class="swiper-button-next"></div>
</div>
It's not working perfectly.
I have created something in Owl Carousel and hope it will be helpful for your scenario. Check it: