Dose Carousel has some events, so we can put some callbacks into it.
Like onSlideStart, onSlideEnd, etc.
Maybe add customized 'carouselNext' and 'carouselPrev' ?
Having same question here. Would be nice to have events and callbacks!
Also, is there any possible current workaround/hack to listen for these events?
EDIT: I didn't see it in documentation, but I found an onCycleTo option. Half-way solves my problems.
@clxy perhaps, you're interested in this.
$('.carousel').carousel({
fullWidth: false,
indicators: true,
noWrap: true,
onCycleTo: function (ele, dragged) {
console.log(ele);
console.log($(ele).index()); // the slide's index
console.log(dragged);
}
});
@DavisMiculis Thank you very much! Because of gesture, I switched to WebView + ViewPager a while ago. But thanks anyway!
This should be re-opened. It's not a personal issue, events could be really useful to other developers as well.
I agree on re-opening this issue, such events should be documented on http://materializecss.com/carousel.html as a plugin option
Added in 42734619 and will be fleshed out more in the v1 dev branch
materialize oncycleto is not working as expected in 1.0.0-beta.
$('.carousel').carousel({onCycleTo: function(slide){console.log(slide);}});
i need it to get triggered when a new slide is cycled to. but its not happening.is there any way around to achieve it??
There is still no mention of what's inside the data object.
Most helpful comment
Having same question here. Would be nice to have events and callbacks!
Also, is there any possible current workaround/hack to listen for these events?
EDIT: I didn't see it in documentation, but I found an
onCycleTooption. Half-way solves my problems.@clxy perhaps, you're interested in this.