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

$CurrentIndex() issue on first load #251

Closed
giuliac1989 opened this issue Jul 1, 2019 · 2 comments
Closed

$CurrentIndex() issue on first load #251

giuliac1989 opened this issue Jul 1, 2019 · 2 comments

Comments

@giuliac1989
Copy link

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

jssor commented Jul 1, 2019

I think you can get the $CurrentIndex after a few mini seconds.

@jssor
Copy link
Owner

jssor commented Oct 30, 2019

The issue has been fixed.

@jssor jssor closed this as completed Oct 30, 2019
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

No branches or pull requests

2 participants