Fixed small tiny issue with the carousel having less the maximum number of visible items i.e. none in the hidden div
🚀 Deploy website on push / 🎉 Deploy (push) Successful in 20s
🚀 Deploy website on push / 🎉 Deploy (push) Successful in 20s
Signed-off-by: rodude123 <rodude123@gmail.com>
This commit is contained in:
@@ -376,6 +376,14 @@ function carouselLoop(carouselInner, allItems)
|
||||
visibleCards.push(cards[i]);
|
||||
}
|
||||
|
||||
if (allItems.children.length === 0)
|
||||
{
|
||||
// if there are no cards in the carousel, don't show the arrows
|
||||
prev.style.visibility = 'hidden';
|
||||
next.style.visibility = 'hidden';
|
||||
return;
|
||||
}
|
||||
|
||||
next.addEventListener('click', () =>
|
||||
{
|
||||
const firstCard = visibleCards.shift();
|
||||
|
||||
Reference in New Issue
Block a user