I want to make carousel slider with middle item (active item) is bigger than other. Like this image below
So i use callback function of react-multi-carousel
<Carousel
className="relative"
responsive={responsiveCarouselTournamentBanner}
// autoPlay={true}
autoPlaySpeed={3000}
infinite
arrows={false}
itemClass="custom-item-class"
// centerMode={true}
slidesToSlide={1}
beforeChange={(nextSlide, current) => {
console.log("Before Change: ", nextSlide, "Current: ", current)
setSlideIndex(nextSlide)
}}
// containerClass={`${
// slideIndex % 2 === 0 ? "custom-container-odd" : "custom-container-even"
// }`}
>
{data?.banners?.map((item, index) => (
<img
key={index}
data-index={index}
src={item || "/images/tournament-img-default.png"}
className="w-full max-w-[90%] h-[210px] md:max-w-[858px] md:h-[482px] object-cover mx-auto rounded-xl banner-primary-color"
alt="dgg-banner"
/>
// <div key={index}>ABC</div>
))}
</Carousel>
Like this. I want to use slideIndex from nextSlide,current in beforeChange. But with Infinity mode, totalItems will double. And i cannot control my items in carousel.
So i want to ask my question to handle this case of carousel like this one. Many thanks. I struggle with this issue for a week.