Skip to content

Conversation

@hejob
Copy link

@hejob hejob commented May 25, 2025

Bug description:

In 'fade' mode using pagers, when previous transition fade animation is still ongoing (say, from slide index A to slide index B), clicking on another pager (say, slide index C) results in as if the third pager cannot be clicked. The current active slide and pager remains showing the previous one (index B). But actual activate index seems to be the newest one (index C), which can be told by trying to move to next/prev slide or switch to other slides using pager. The symptoms are similar with autoplay on.

Confirmed case:
In Chrome 136.0.7103.114 on MacOS amd64, sets bxslider on 3 slides with 'fade' mode and a relatively slow speed like 1200.
a) Set autoplay to false, click the 2nd pager, and quickly click the 3rd pager.
b) Set autoplay to true, when transition animation is working, quickly click another pager than the next slide.

Possible reason:
In goToSlide() function, when called before last fade transition is finished, the variable slider.working is still true, preventing ui following transition codes to execute, yet it sets active index to the new value. The last fadeIn() animation, however, still executes, and when finished, shows the last active slide instead of the newest set one. This causes an mismatch between ui state and internal data.

Fix:
Possible fix of goToSlide() may include:

  1. Reject slide pager click when fading is still executing. Just do nothing and return early, keeping the current active index not touched.
  2. In fade mode only, stops and finishes current animations first using jQuery stop(true, true) and sets a new fadeOut/fadeIn animation. Utilises jquery's animation stop() function.

Current PR tries to implement the latter method.

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.

1 participant