ResponsiveSlides.js icon indicating copy to clipboard operation
ResponsiveSlides.js copied to clipboard

How to get current slider index

Open ryscript opened this issue 6 years ago • 1 comments

It's a nice plugin, though, I need to get the current active slide, and not sure how it can be done using

after: function(){}

Thanks

ryscript avatar Apr 21 '18 07:04 ryscript

The visible slide have the z-index equals to 2, so just get the <li> with such z-index.

This example uses Jquery, and I assume the only <li> tags are the slides ones:

$('li').each(function(index , el){
  if($(el).css('z-index') == 2){
   console.log(index);
  }
});

DraconianS avatar Jul 16 '18 20:07 DraconianS