Leandro SS Leandro SS - 3 months ago 283
jQuery Question

Materialize Carousel Slider autoplay

Is there a parameter to make the materialize carousel slider to auto play?

$('.carousel').carousel();


for example (this parameter doesn't work):

$('.carousel').carousel({
autoplay: true
});


Thank you!

Answer

I resolved the problem with this:

$('.carousel').carousel({
    padding: 200    
});
autoplay()   
function autoplay() {
    $('.carousel').carousel('next');
    setTimeout(autoplay, 4500);
}
Comments