woocommerce / FlexSlider

An awesome, fully responsive jQuery slider plugin
http://www.woocommerce.com/flexslider/
GNU General Public License v2.0
4.91k stars 1.69k forks source link

Fix Bug in FlexSlider #1585

Closed AmosGarner closed 1 month ago

AmosGarner commented 8 years ago

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.

JanStorm commented 1 year 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;