maxmarinich / react-alice-carousel

React responsive component for building content galleries, content rotators and any React carousels
MIT License
842 stars 92 forks source link

Centering a target inside the carousel #232

Closed NoHop3 closed 2 years ago

NoHop3 commented 2 years ago

Hello! Did not know how to reach more efficiently so I would write here. Hope you would help me out as a creator of this awesome carousel library.

In short - I am building a fullstack project, I am fetching some product data from my backend and presenting it in a responsive way. All good on a phone device - having only 1 item at a time. image

However - this is what I end up with on a tablet or laptop image image

To further explain taking in consideration the last image I want the targetImage which is the one with opacity:1 to be at position 3 (in the center of the carousel)

I am helpless to order them accordingly. I am correctly moving the target accross my items like so: ezgif com-gif-maker

Sliding is moving forward/backkwards and changing my name/price properties but I cannot make the target centered. I am clueless.

This is what I am using so far image image

EDIT: Posted a question on StackOverFlow

maxmarinich commented 2 years ago

Hi, @NoHop3! Please see base examples here. Use common css to customize your elements like in the example below:

Снимок экрана 2022-05-02 в 15 32 09