0

在底部的本文档中,有关于事件及其参数(事件、下一张幻灯片、当前幻灯片)的信息。

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

我怎样才能className得到nxt_slideand cur_slide

4

1 回答 1

0

从问题中提到的文档中,参数(next slide, current slide).li元素。

beforeshow.uk.slideshow在显示新幻灯片之前触发的事件(在动画完成之前)。因此,为了访问它们并获得他们的课程,您可以使用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.
});
于 2016-09-12T10:36:45.757 回答