wandoledzep/bxslider — Issue #82: Combined Navigations : goToSlide() & Next() / Prev() 
Author: rohnn
Created: 2012-02-02 09:29:26+00:00
State: open

Good day,

I am hitting some issue while having external goToSlide(x) & goToPreviousSlide() goToNextslide() on the same page for the same slider.

Imagine this :
Main nav (somewhere in the page aside element ) :
nav_1 => goToSlide(5)
nav_2 => goToSlide(7)
nav_3 => goToSlide(10)

Main nav Works fine !

Diaporama controls (external controls in image overlay)
d_nprev => goToPreviousSlide()
d_stop => stopShow() || startShow() (depending on condition) // not involved in the issue
d_nxt => goToNextSlide()

Diapo Cotnrol Work fine !

So, what's the deal ?

When using nav_2 ( goToSlide(7) ) then, eiher previous or next, the slide index is buggy.
nav_2 updates the index to 7.
but then nxt or prev does not read the updated value, but the one that was before the goToSlide() call.
(logging the indix with my_slider.getCurrentSlide() )

I managed to find a way around by replacing
goToNextSlide() with idx = getCurrentSlide() +1 ; goToSlide(idx) ;

Note : I am not parsing full code, just function names, but the code is correct in the app.

Any idea ?