stevenwanderski / bxslider-4

Responsive jQuery content slider
Other
4.22k stars 1.85k forks source link

Multiple clicks on next/prev issue #998

Open Matthieusch opened 8 years ago

Matthieusch commented 8 years ago

Hi!

If we click multiple times on next or prev button quickly, it'll increase the slider.active.index but only one item was showed. Next click: all indexed items will show up at once.

Please update the slider.active.index only if slider.working != true.

Here is the fix on jquery.bxslider.js:

1342     // if plugin is currently in motion, ignore request
1343     if (slider.working || slider.active.index === slider.oldIndex) { return; }
1344     // declare that plugin is in motion
1345     slider.working = true;

1347     // store the old index
1348     slider.oldIndex = slider.active.index;
1349     //set new index
1350     slider.active.index = setSlideIndex(slideIndex);

Regards, Matthieu

ViieeS commented 8 years ago

Confirm for 4.2.5. 4.1.2 from site works good.

demyan1411 commented 8 years ago

Yes, confirm it please.

Matthieusch commented 8 years ago

Confirmed for 4.2.5

geogkary commented 8 years ago

Seems like line 1343 is causing the slider's navigation to stop working when a user clicks on the prev/next buttons repeatedly (2 or 3 times) within a second.

The only way I managed to solve it was by commenting line 1343 as mentioned above. Seems like the 2nd or 3rd repeated click is treated under the 'slider is currently in motion'.

tomaskikutis commented 8 years ago

https://github.com/stevenwanderski/bxslider-4/issues/835#issuecomment-188816574