0

In this documentation in the bottom there is information regarding the event and its parameter (event, next slide, current slide).

$('#elemId').on('beforeshow.uk.slideshow', function(event, nxt_slide, cur_slide){
    // logic here...
});

How can i get the className of the nxt_slide and cur_slide?

Shift 'n Tab
  • 8,808
  • 12
  • 73
  • 117
  • I guess you can get element using `$(this).closest('li').next()` or `.prev()` – Rajesh Sep 12 '16 at 10:09
  • i think it will just get the closest `li` of the slideshow but i just solve my problem buy using this `$(cur_slide).attr('class');` – Shift 'n Tab Sep 12 '16 at 10:14

1 Answers1

0

From the documentaton mention from the question, the parameter (next slide, current slide). are li elements.

beforeshow.uk.slideshow event fired before showing a new slide (before animation is finished). Therefore in order to access them and get their class you can use jquery:

$('#elemId').on('beforeshow.uk.slideshow', function(event, nxt_slide, cur_slide){
    var nxt-slide-cls = $(nxt_slide).attr('class');
    alert(nxt-slide-cls);

    // You can get the cur_slide class name with the same approach.
});
Shift 'n Tab
  • 8,808
  • 12
  • 73
  • 117
  • You should answer your own question in cases where you have researched and you think you approach is better suited for certain situation or is better than some existing answer, which will help others. In such cases, please make it descriptive and try to incorporate a working fiddle. – Rajesh Sep 12 '16 at 10:56