在底部的这个文档中,有关于事件及其参数的信息(事件、下一张幻灯片、当前幻灯片)。
$('#elemId').on('beforeshow.uk.slideshow', function(event, nxt_slide, cur_slide){
// logic here...
});我怎样才能得到className of the nxt_slide and cur_slide**?**
发布于 2016-09-12 10:36:45
从问题中提到的文档来看,参数(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.
});https://stackoverflow.com/questions/39447821
复制相似问题