[Help]: Loop working with 4+ images? #859
-
SummaryHey all. I’m trying to get loop working for 4 images but cannot work out how. Basically I have a carousel with 3 images showing and I’d like it to loop even if I have just four images. Is this possible? My basic setup below (any help would be appreciated):
I’m passing images to the carousel from my page, and have the following scss setup:
If applicable, which variants of Embla Carousel are relevant to this question?
Additional informationNo response CodeSandbox exampleNo response |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Ok so i did a bit of digging and ended up writing a solution if it helps anyone in the future here. It basically checks to see if there are enough images to loop, and if not, it will make duplicates and add them back into the mix. See below:
|
Beta Was this translation helpful? Give feedback.
Ok so i did a bit of digging and ended up writing a solution if it helps anyone in the future here. It basically checks to see if there are enough images to loop, and if not, it will make duplicates and add them back into the mix. See below: