My setup looks something like this:
$(".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!
});
What I'm trying to do is to check if a certain slide is reached and then do some other action instead of transitioning to the next slide.
I tried return false
, e.stopPropagation()
, e.stopImmediatePropagation()
and combinations thereof, but the slideshow still continues to the next slide, no matter what I do.
Is there a way to cancel the transition to the next slide from inside the cycle-before
event handler?