Is there a way to show less thumbnails when less than 5 slides? #21
-
I have only 3 images for one of my pages so the thumbnails repeat, is there a way to only show the number of thumbnails = to the number of slides if less than 5 slides? The library is great btw, thanks! |
Beta Was this translation helpful? Give feedback.
Answered by
igordanchenko
Sep 12, 2022
Replies: 1 comment 2 replies
-
The Thumbnails plugin uses <Lightbox
open
slides={slides}
plugins={[Thumbnails]}
carousel={{ preload: Math.min(Math.floor(slides.length / 2), 2) }}
/> https://codesandbox.io/s/yet-another-react-lightbox-21-rjo2qd?file=/src/App.js However, you'd still see repeating thumbnails when you have an even number of photos. |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
igordanchenko
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The Thumbnails plugin uses
carousel.preload
prop when determining how many thumbnails to show. So, in this case, you could setcarousel.preload
to 1.https://codesandbox.io/s/yet-another-react-lightbox-21-rjo2qd?file=/src/App.js
However, you'd still see repeating thumbnails when you have an even number of photos.