在底部的本文档中,有关于事件及其参数(事件、下一张幻灯片、当前幻灯片)的信息。
$('#elemId').on('beforeshow.uk.slideshow', function(event, nxt_slide, cur_slide){
// logic here...
});
我怎样才能className
得到nxt_slide
and cur_slide
?
在底部的本文档中,有关于事件及其参数(事件、下一张幻灯片、当前幻灯片)的信息。
$('#elemId').on('beforeshow.uk.slideshow', function(event, nxt_slide, cur_slide){
// logic here...
});
我怎样才能className
得到nxt_slide
and cur_slide
?
从问题中提到的文档中,参数(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.
});