Scrollable autoscrolling
The Autoscroll plugin provides an automatic scrolling capability. It advances to the next items in pre-configured intervals. Here is the autoscroll plugin in action:
standalone demoYou can configure the number of items being scrolled and the interval of the scrolls. When navigational elements are mouseovered the automatic scrolling is paused.
Usage
Here is the JavaScript setup for the example above:
Configuration
Here is a full list of available configuration options:
property | default | description |
---|---|---|
steps | 1 |
The number of pages being scrolled within a single autoscroll. |
interval | 1000 |
The time (in milliseconds) between autoscrolls. If this is the only configuration variable for this plugin you can specify the interval value directly for the plugin. For example: $("#scroller").scrollable().autoscroll(2000); |
autoplay | true |
When enabled the scrolling starts automatically upon page load. If this is set to false, the autoscroll can be started by using the play() method (see below). |
autopause | true |
If this property is set to true then, when any navigational buttons are mouseovered, the autoscrolling will pause. |
JavaScript API
The following methods are added to the main JavaScript API of the scrollable and they are ready to be used after the plugin has been installed.
method | return value | description/example |
---|---|---|
play | API |
Begins a playable autoscroll. |
pause | API |
Pauses the autoscroll and it will resume when the mouse has moved away from the navigational buttons. |
stop | API |
Stops the autoscroll. Autoscroll can only be resumed by calling the play() method. |