Closed AmosGarner closed 1 month ago
This can sometimes lead to slider.visible being 0, e.g. when the elements margin overflows the width of the slider. We experienced that on mobile pages.
In our case we added a check, so that the slider.visible is at least always 1. (But i think there could be a better solution):
slider.visible = Math.floor(slider.w/(slider.itemT)) || 1;
slider.visible was being set to a floor of slider width divided by item width. This change sets the variable to the floor of slider width divided by item total (item width + item margin). This prevents a bug where the slider would not function because it was calculating the item's width only and not it's full size.