$CurrentIndex() issue on first load
giuliac1989 opened this issue · comments
Giulia commented
Hi,
I need to get the current slide index, but on first load it return -1.
Below my code:
$(document).ready(function () {
var galleryOptions = {
$Loop: 1,
$DragOrientation: 0,
$SlideDuration: 500,
$ArrowNavigatorOptions: {
$Class: $JssorArrowNavigator$,
$ChanceToShow: 2,
$Steps: 1
},
$ThumbnailNavigatorOptions: {
$Class: $JssorThumbnailNavigator$,
$ChanceToShow: 2,
$ActionMode: 1,
$SpacingX: 5,
$Cols: 6,
$Align: 0
}
};
});
var gallery = new $JssorSlider$('gallery', galleryOptions);
var currentSlideIndex = gallery.$CurrentIndex(); // return -1
I can't figure out why. Do you have any idea?
Thanks!
jssor commented
I think you can get the $CurrentIndex after a few mini seconds.
jssor commented
The issue has been fixed.