Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Bug in FlexSlider #1585

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fix Bug in FlexSlider #1585

wants to merge 1 commit into from

Conversation

AmosGarner
Copy link

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.

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
Copy link

JanStorm commented Apr 5, 2023

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;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants