Method | Description |
---|---|
rotator | Creates a new instance of the rotator plugin |
goNext | Sends the rotator to the next child index |
goToIndex | Sends the rotator to the user defined index in the parameter |
onError | Dispatches an error object relaying the target failure and error message |
pause | Pauses the rotator. |
start | Starts the rotator. |
Property | Description |
---|---|
arrows | The class of the left and right arrow controls with unique number 0 indexed |
tranSpeed | The time a transition should last in milliseconds |
delay | The time a child should display before the transition in milliseconds |
auto | Sets auto scrolling through rotator. true starts animation automatically. false disables auto rotating |
loop | Infinite scroll on or off, default true infinitely loops |
backwards | sets the rotator to run backwards. Loop must be set to true to run backwards |
onChange | onChange event fires when the transition animation begins |
endChange | endChange event fires when the transition animation ends |
Description: Creates a new instance of the rotator plugin
$(".slider").rotator();
Description: Sends the rotator to the next child index
$(".slider").data('rotator').goNext();
goNext also accepts a parameter of 1 or -1. This will cause the rotator to either rotate backwards to the previous child or continue forwards.
Description: Sends the rotator to the next child index
$(".slider").data('rotator').goToIndex(2);
The rotator will animate to the child specified. If the child is out of range an error is thrown and the rotator will continue on like normal.
Description: Dispatches an error object relaying the target failure and error message
$(".slider").data('rotator').onError = function(e){alert("error in "+e.target)}
The error object contains two properties; target and error. The target is where the rotator failed. For example, it may be in the initializing where too few children are present in the slider ( the target would be init) or when goToIndex is called with an index out of range (target is goToIndex). The error is a descriptive error message of the failure.
Description: Pauses the rotator
$(".slider").data('rotator').pause();
Clears the interval at which the slider is rotating if auto is true (default).
Description: Starts the rotator
$(".slider").data('rotator').start();
Starts the rotator rotating regardless of auto. Can be used to restart a paused rotator or start a rotator whose auto property is set to false. This will set auto to true and the rotator will continue rotating until paused again.
Description: The class of the left and right arrow controls with unique number 0 indexed
$(".slider").rotator({arrows:{left:".leftArrow",right:".rightArrow"}});
arrows is an object containing class identifiers for the left and right arrow DOM objects.
Default: {left:".leftArrow"+i,right:".rightArrow"+i}
Where i is the 0 based increment of the number of sliders on the page.
Description: The time a transition should last in milliseconds
$(".slider").rotator({tranSpeed:400});
Default: 800
Description: The time a child should display before the transition in milliseconds
$(".slider").rotator({delay:10000});
Default: 4000
Description: Sets auto scrolling through rotator. true starts animation automatically. false disables auto rotating
$(".slider").rotator({auto:false});
Default: true
Description: Infinite scroll on or off, default true infinitely loops
$(".slider").rotator({loop:false});
If set to false the slider will scroll back to the 0 index when it has reached the last child
Default: true
Description: Sets the rotator to run backwards. Loop must be set to true to run backwards
$(".slider").rotator({backwards:false});
The rotator will rotate from left to right instead of right to left by default
Default: false
Description: onChange event fires when the transition animation begins
$(".slider").rotator({onChange:function(i){alert('next')}});
When the onChange event is fired a parameter is passed containing the new index of the rotator
Default: function(){}
Description: endChange event fires when the transition animation ends
$(".slider").rotator({endChange:function(i){alert('next')}});
When the endChange event is fired a parameter is passed containing the new index of the rotator
Default: function(){}