The carousel widget allows organizing items into panels and flipping through them easily, showing only the active panel. The slideshow adds auto-playing and navigation on top of the carousel.
Carousel overview
The carousel widget structure
- carousel: the carousel widget, specified as:
- element with
data-widget="carousel"
- element with
- panel: the panels that contain the various items, specified as one of:
- elements with
role="group" - using the
data-panelsoption, specified as a jQuery selector relative to the widget - children of the 1st child of the widget if the controls are below the panels
- children of the 2nd child of the widget
- elements with
- item: the individual items in the carousel, specified as one of:
- elements with
role="option" - using the
data-itemsoption, specified as a jQuery selector relative to the widget - children of the panels
- elements with
- controls: the controls that allow switching panels, specified as one of:
- elements with
role="toolbar", if thedata-controlsoption is notfalse - children of the 2nd child of the widget if the controls are below the panels
- children of the 1st child of the widget if the widget has several children
- auto-generated
- elements with
- previous button: the button that allows switching to the previous panel, specified as one of:
- elements with
data-role="previous", if thedata-prevoption is notfalse - using the
data-prevoption, specified as a jQuery selector relative to the widget - auto-generated
- elements with
- next button: the button that allows switching to the next panel, specified as one of:
- elements with
data-role="next", if thedata-nextoption is notfalse - using the
data-nextoption, specified as a jQuery selector relative to the widget - auto-generated
- elements with
Options for the carousel widget
data-event: what event to respond to (clickby default)data-cycleItems: whether to cycle through the items or not (trueorfalse, default isfalse)
Events for the carousel widget
beforeSelect: triggered on the carousel element before the selection happensafterSelect: triggered on the carousel element after the selection happens
Both events have the following parameters:
item: a reference to the current itempanel: a reference to the current panel
Default carousel
With inline preview
Inline previews for each option can be set, by adding:
data-target: jQuery selector to the target element that contains the previewdata-url: url to use for the content of the target element (for itssrcattribute)
With controls
Vertical with controls
With custom controls
With custom controls and cycleItems=True
Slideshow
The slideshow widget structure
- slideshow: the carousel widget, specified as:
- element with
data-widget="slideshow"
- element with
- panel: same as carousel
- item: same as carousel
- controls: same as carousel
- previous button: same as carousel
- next button: same as carousel
- play button: the button that allows auto-playing the items, specified as one of:
- elements with
data-role="play", if thedata-playoption is notfalse - using the
data-playoption, specified as a jQuery selector relative to the widget - auto-generated
- elements with
- pause button: the button that allows pausing the items, specified as one of:
- elements with
data-role="pause", if thedata-pauseoption is notfalse - using the
data-pauseoption, specified as a jQuery selector relative to the widget - auto-generated
- elements with
- selectors: the selectors that allow jumping to a specific item, specified as one of:
- elements with
data-role="selector" - using the
data-selectorsoption, specified as a jQuery selector relative to the widget - auto-generated
- elements with
Options for the slideshow widget
Same as carousel, plus:
data-autoplay: whether to auto-play the items (trueorfalse, default istrue)data-duration: how long each item in the slideshow should be shown (in ms, default is5000)
Events for the slideshow widget
Same as carousel.