v7.3.0

Carousel
Abstract

A virtualized container of items that can be scrolled either horizontally or vertically. As scrolling occurs, a configured number of visible items (slots) are dynamically positioned and reconfigured to give the appearance that all items in the specified range are present.

To create a carousel, a configureSlot function must be provided that will return the configuration object for a given slot index. Slot index 0 is special, and whenever the range is not empty, 0 must be included in the range. The meaning of a slot index, however, is defined by the developer and only interpreted by the developer-provided configureSlot function.

Slot indexes are converted into virtual scroll positions and given to an InfinityScroller. This special scroller allows for negative scroll positioning as well as unbounded scroll range.

This widget is not intended to be used standalone, but as part of higher-level widgets such as MultiDatePicker.

No results

Configs

Configs are options you supply in a configuration object when creating an instance of this class
  • The HTML to render when the carousel's range is empty. To avoid XSS attacks, it is safer to use emptyText instead.

    Has a corresponding runtime emptyHtml property.

  • emptyText : StringNo items to display

    The text to render when the carousel's range is empty. This text is automatically encoded and is safe from XSS issues. To render markup when the carousel is empty, see emptyHtml.

    Has a corresponding runtime emptyText property.

  • The number of slots to render beyond what is visible in the carousel. These reserve items are critical to giving the appearance of continuity as the carousel is being scrolled. A minimum of 1 is required and is generally sufficient for slots that are reasonably large. If slots are small (maybe less than 100px), it may be helpful to provide additional reserve slots.

    Has a corresponding runtime reserveSlots property.

  • snap : Booleantrue

    Set to false to disable scroll snapping and allow free scrolling through the carousel.

    Has a corresponding runtime snap property.

  • Set to true to enable vertical mode. By default, carousels scroll horizontally.

    Has a corresponding runtime vertical property.

Properties

Properties are getters/setters or publicly accessible variables on this class
  • isCarousel : Booleantrue
    READONLY
    static
    ADVANCED
    Identifies an object as an instance of Carousel class, or subclass thereof.
  • The HTML to render when the carousel's range is empty. To avoid XSS attacks, it is safer to use emptyText instead.

    Has a corresponding emptyHtml config.

  • emptyText : StringNo items to display

    The text to render when the carousel's range is empty. This text is automatically encoded and is safe from XSS issues. To render markup when the carousel is empty, see emptyHtml.

    Has a corresponding emptyText config.

  • The number of slots to render beyond what is visible in the carousel. These reserve items are critical to giving the appearance of continuity as the carousel is being scrolled. A minimum of 1 is required and is generally sufficient for slots that are reasonably large. If slots are small (maybe less than 100px), it may be helpful to provide additional reserve slots.

    Has a corresponding reserveSlots config.

  • scrolling : Boolean
    READONLY

    This will yield true when the carousel is currently scrolling.

  • snap : Booleantrue

    Set to false to disable scroll snapping and allow free scrolling through the carousel.

    Has a corresponding snap config.

  • Set to true to enable vertical mode. By default, carousels scroll horizontally.

    Has a corresponding vertical config.

  • isCarousel : Booleantrue
    READONLY
    ADVANCED
    Identifies an object as an instance of Carousel class, or subclass thereof.

Functions

Functions are methods available for calling on the class
    • sync( )
      internal

      Synchronizes the scroll range and child items based on the current configuration and scroll position. This is called in response to scroll events and when the carousel is reconfigured.

    type: carousel

    Source path

    Core/widget/Carousel.js

    Contents