1, Plug-in Introduction
Supports infinite seamless loop scrolling.
The smallest operation DOM, which replicates the DOM only once during initialization, and then does not manipulate the DOM to maximize performance.
The default DOM structure is: #demo >ul>li*n.
Rich configuration, simple interface.
Note: Seamless scrolling does not support Prev, next operations, OnBeforeChange, OnAfterChange callbacks are not supported.
2, plug-in parameters
Default parameters
$.fn.scrollable = {
Content Area Selector
ContentSelector: "UL",
width, more than hidden
Width: "Auto",
Height, more than hidden
Height: "Auto",
Scrolling direction
Direction: "Top",
Number of items per scroll
If 1, scroll 1 at a time, and it will be the end of an item when paused
If 0, then seamless scrolling, the pause may be in the middle of a project
Scrollnum:1,
Delay Time
delay:2000,
Animation time, if the number of scrolling is 0, then the full amount of animation time is scrolled
duration:678,
Whether to play automatically
Isautoplay:true,
Whether to hover over a mouse pause
Ishoverpause:true,
Callback before change
ONBEFORECHANGE:EMPTYFN,
Callback after change
Onafterchange:emptyfn
};
3, Plug-in control
3.1. Scroll to
$ ("#demo"). Scrollable (index[, duration][, callback]);
3.2, play
$ ("#demo"). Scrollable ("play");
3.3. Suspend
$ ("#demo"). Scrollable ("pause");
3.4, former
$ ("#demo"). Scrollable ("prev");
3.5, after
$ ("#demo"). Scrollable ("Next");