Option name | Type | Description |
---|---|---|
element | domelement | The element to act as a slideshow, containing one or more children with class 'js-slide' or 'slide' |
options | object | An object contianing the settings for this slideshow |
NATION.Utils
NATION.EventDispatcher
Either NATION.Animation or jQuery
A JavaScript-powered slideshow.
In order to function correctly, the HTML representing each slide should have a classname of either 'js-slide' or 'slide'.
If previous/next buttons are required, these should have class 'js-next' and 'js-previous', or 'next' and 'previous'.
If captions are required, a container must exist with class 'js-captions' or 'captions'. To define a caption for a slide, include elements with the class 'js-caption' or 'caption' anywhere inside selector. These will be gathered and moved into the .captions element by this class, so it's wise to ensure that caption styles aren't affected by the move into the captions container element.
If a current slide display is requird, selector must contain an element with classname 'js-current' or 'current'
If a total slides display is required, selector must contain an element with classname 'js-total' or 'total'
If clickable pips are required, an element should exist with class 'js-pips' or 'pips'. Each element that represents a single pip should have class 'js-pip' or 'pip'.
An event that fires when the current slide is about to change
An event that fires when all images found within the slideshow have loaded
Returns the zero-indexed ID of the currently visible slide
Returns the total number of slides
Start automatically rotating through images
Stop automatically rotating through images
Option name | Type | Description |
---|---|---|
slideID | number | The ID (zero-indexed) of the slide to show |
immediate | boolean | If true, no animation will play, and the slide change will happen immediately |
Show a slide specified by slideID, either via slide or fade, depending on the slideshow options. This will also stop autoCycling if that was active