Skip to main content

Autoplay

Automatically change the active page after a time interval.

This is optional plugin. To use it, either include carousel.umd.js file or import as ES6 module. Example:

import { Autoplay } from "@fancyapps/ui/dist/carousel.autoplay.esm.js";
Carousel.Plugins.Autoplay = Autoplay;

Configure (demo):

const myCarousel = new Carousel(document.querySelector("#myCarousel"), {
Autoplay: {
timeout: 1000,
},
});

Options

timeout {Number}

Autoplay interval timeout. Default: 3000

hoverPause {Boolean}

Should Autoplay pause on mouse hover. Default: true

Methods

start(): void

Enable autoplay. Example:

myCarousel.plugins.Autoplay.start()

stop(): void

Disable autoplay. Example:

myCarousel.plugins.Autoplay.stop()