2
我的设置看起来是这样的:有没有办法在jQuery Cycle2插件中取消事件?
$(".slideshow").cycle({
slides: ".slide",
timeout: 0,
speed: 200,
swipe: true
}).on("cycle-before", function(e, opts, outgoing, incoming, forwardFlag){
// trying to cancel event here when some condition is met!
});
我试图做的是检查是否达到了一定的幻灯片,然后做一些其他的动作,而不是过渡的下一张幻灯片。
我试过return false
,e.stopPropagation()
,e.stopImmediatePropagation()
及其组合,但无论我做什么,幻灯片仍会继续下一张幻灯片。
有没有办法取消过渡到从cycle-before
事件处理程序内的下一张幻灯片?
暂停幻灯片不适合你吗?像$('#mySlideshow')。cycle('pause'); – Maurice