(This is definitely not a duplicate).
I implemented a Bootstrap 4 carousel that displays multiple items. It has to cover these specific requirements for different screen sizes:
- 0 - md screens (just before md starts): carousel with 2 visible items
- md - lg screens (just before lg starts): carousel with 3 visible items
- lg - xl screens (just before xl starts): carousel with 4 visible items
- xl screens and beyond: carousel with 6 visible items
It works very well except on the xl media query. I've been trying to fix this issue for hours without success:
- if the screen's width is 1200px or more (xl), the carousel is only displaying 4 or 5 items instead of 6, therefore causing a strange flickering behavior when cycling through the items.
sm screen 675px. This works fine.
md screen 768px. This works fine.
lg screen 992pxx. This works fine.
xl screen 1200px As you can see, only 4 items are being displayed (sometimes 5 when starting the example). This screen size should be displaying 6 items.
- if you press Prev and then Next, there will be a small but unidentified delay for the new item coming in from the right of the carousel.
The first bug must be fixed, but it would be nice to also fix the 2nd one.
Instead of pasting the code here, I've added a live example in the link below:
Thanks for your help!