Plugin Autoplay
This plugin adds autoplay feature to the Tiny Carousel. All you need to do is to install the plugin and watch that the slides are changing automatically!
The plugin also extends Tiny Carousel instance with additional methods. Read more about it in the instance methods section.
To learn on how to install and use plugin, please see our usage guide.
For configuration options please see PluginConfig
below.
PluginConfig
Properties:
{number} autoplayTimeout = 4000
{boolean} autoplayImmediate = false
{boolean} pauseOnHover = true
Details:
PluginConfig
is an object passed along to thecarousel.use
method.autoplayImmediate
decides whether the first slide change should happen immediately after runningcarousel.play
method or after a timeout. Default value:4000
autoplayTimeout
sets a time delay (in milliseconds) between slide changes. Default value:false
pauseOnHover
specifies if the carousel autoplay should pause when hovered over and resume automatically when loses focus. Default value:true
Instance methods
carousel.play
Arguments:
Returns:
this
- this TinyCarousel instance (for chaining purposes)Usage:
Method used to enable the automatic slide playback. It’s behavior can be changed via
options
argument orinstance config
(defaultConfig
included). Each slide will be changed after a timeout specified byautoplayTimeout
.
carousel.pause
Arguments:
Returns:
this
- this TinyCarousel instance (for chaining purposes)Usage:
Method which pauses the autoplay action.
Options
PlayOptions
Properties:
{boolean} autoplayImmediate
Details:
Data type which holds additional configuration of
carousel.play
method. Properties have the same meaning as inPluginConfig
data type.
PauseOptions
Properties:
{boolean} leavePauseOnHoverListeners
Details:
Data type which holds additional configuration of
carousel.pause
method.leavePauseOnHoverListeners
- whethercarousel.pause
should remove mouse listener handlers which were added whenPluginConfig.pauseOnHover
was set totrue
or not