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:
PluginConfigis an object passed along to thecarousel.usemethod.autoplayImmediatedecides whether the first slide change should happen immediately after runningcarousel.playmethod or after a timeout. Default value:4000autoplayTimeoutsets a time delay (in milliseconds) between slide changes. Default value:falsepauseOnHoverspecifies 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
optionsargument orinstance config(defaultConfigincluded). 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.playmethod. Properties have the same meaning as inPluginConfigdata type.
PauseOptions
Properties:
{boolean} leavePauseOnHoverListeners
Details:
Data type which holds additional configuration of
carousel.pausemethod.leavePauseOnHoverListeners- whethercarousel.pauseshould remove mouse listener handlers which were added whenPluginConfig.pauseOnHoverwas set totrueor not