I have a situation where I need a carousel that only has about 8 images, but will show 3 images at a time on the screen.
But I need the navigation dots to go to each image, not to each page of images.
This will give me 8 navigation dots, one for each image.
I can't find any way to do it as the code exists now.
I pulled the code, and modified it to make it work how I need it, but thought I would suggest adding this as a feature.
I implemented it by adding a boolean parm, dotPerImage, and implemented it like this:
I have a situation where I need a carousel that only has about 8 images, but will show 3 images at a time on the screen. But I need the navigation dots to go to each image, not to each page of images. This will give me 8 navigation dots, one for each image. I can't find any way to do it as the code exists now.
I pulled the code, and modified it to make it work how I need it, but thought I would suggest adding this as a feature.
I implemented it by adding a boolean parm, dotPerImage, and implemented it like this:
export const getDotsNavigationLength = (itemsCount = 0, itemsInSlide = 1, autoWidth, dotPerImage) => { if (autoWidth || dotPerImage) { return itemsCount; } if (Number(itemsInSlide) !== 0) { return Math.ceil(itemsCount / itemsInSlide) || 0; } return 0; };