metafizzy / flickity

:leaves: Touch, responsive, flickable carousels
https://flickity.metafizzy.co
7.52k stars 605 forks source link

Define a speed autoplay with playPlayer #1000

Closed cedricmure closed 4 years ago

cedricmure commented 4 years ago

I would like to set autoPlay: false on beginning and use a button to start the carousel. But how I can define a speed autoplay in this case ?

$carousel.flickity({
   autoPlay: false
});
$button.click(function(){
   $carousel.flickity('playPlayer');
});
XPOL555 commented 4 years ago

@CM-Webdesign you can do the reverse and using the pause/unpause and pausing immediatly after init.

$carousel.flickity({
   autoPlay: 1500
});
$carousel.flickity('pausePlayer');
$button.click(function(){
   $carousel.flickity('unpausePlayer');
});
cedricmure commented 4 years ago

Oh yeah, you right. Thank you !