CrossfadeStage

Shows a crossfade effect when transitioning between a single selected item

Standard rooms

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum tincidunt eu erat sit amet mollis. Phasellus ut consectetur tortor. Aliquam auctor eros vel sapien cursus finibus eget a purus. Pellentesque luctus dui eget magna consequat cursus. Vestibulum accumsan eu sem vitae mollis. Donec in odio convallis elit feugiat laoreet eget ut quam. Ut ultricies erat quis gravida cursus. Ut imperdiet tempus leo, et ultricies erat rutrum et. In quis orci eu eros lacinia accumsan.

Deluxe rooms

Nunc venenatis congue est vitae cursus. Suspendisse porta, augue nec interdum feugiat, lorem erat consequat dolor, eu bibendum magna tellus non lacus. Aliquam nulla ipsum, pharetra sed lectus vitae, ornare vulputate sem. Nunc a justo massa. Nulla et urna eget sem eleifend fringilla nec non nibh. Suspendisse potenti. Sed non dapibus augue, imperdiet facilisis magna. Donec laoreet urna massa, congue consectetur nunc imperdiet sit amet. Etiam eu purus augue. Pellentesque vel ipsum gravida lectus aliquam aliquam.

Suites

Quisque molestie posuere ligula at laoreet. Sed nisi est, semper a suscipit sit amet, porta ultricies enim. Vivamus a arcu nec arcu porttitor gravida eget nec odio. Sed porttitor rutrum turpis, ut egestas arcu sagittis condimentum. Integer consequat eros sed porttitor ullamcorper. Aliquam elementum vehicula arcu, at vulputate mi congue sed. Cras sed nunc ac enim vulputate gravida at non nulla. Aenean varius, turpis ac dapibus lacinia, nisl elit pretium diam, sit amet ornare magna nibh id diam. Aenean accumsan dolor quis massa tristique commodo.

Demo: CrossfadeStage used as the stage for a Tabs element

Overview

This variation of Modes displays a crossfade effect when updating the selected item.

See also

CrossfadeStage is used as the basis for Slideshow and its variations.

API

Ancestry: CrossfadeStage → ModesReactiveElement → HTMLElement

Built with mixins AttributeMarshallingMixin, EffectMixin, ReactiveMixin, ShadowTemplateMixin, SingleSelectionMixin, and SlotItemsMixin.

Extended by classes Slideshow and SlideshowWithPlayControls.

canSelectNext property

True if the selection can be moved to the next item, false if not (the selected item is the last item in the list).

Type: boolean

Defined by SingleSelectionMixin

canSelectPrevious property

True if the selection can be moved to the previous item, false if not (the selected item is the first one in the list).

Type: boolean

Defined by SingleSelectionMixin

[internal.contentSlot] property

Defined by SlotContentMixin

[internal.defaultState] property

The default state for the component. This can be extended by mixins and classes to provide additional default state.

Type: State

Defined by ReactiveMixin

[internal.ids] property

A convenient shortcut for looking up an element by ID in the component's Shadow DOM subtree.

Example: if component's template contains a shadow element <button id="foo">, you can use the reference this[internal.ids].foo to obtain the corresponding button in the component instance's shadow tree. The ids property is simply a shorthand for getElementById, so this[internal.ids].foo is the same as this.shadowRoot.getElementById('foo').

Type: object

Defined by ShadowTemplateMixin

[internal.itemMatchesState](item, state) method

Returns true if the given item should be shown in the indicated state.

Parameters:

  • item: HTMLElement|SVGElement
  • state: PlainObject

Returns: boolean

Defined by ContentItemsMixin

[internal.render](changed) method

Render the indicated changes in state to the DOM.

The default implementation of this method does nothing. Override this method in your component to update your component's host element and any shadow elements to reflect the component's new state. See the rendering example.

Be sure to call super in your method implementation so that your component's base classes and mixins have a chance to perform their own render work.

Parameters:

  • changed: objectdictionary of flags indicating which state members have changed since the last render

Defined by ReactiveMixin

[internal.renderChanges]() method

Render any pending component changes to the DOM.

This method does nothing if the state has not changed since the last render call.

ReactiveMixin will invoke this method following a setState call; you should not need to invoke this method yourself.

This method invokes all internal render methods, then invokes componentDidMount (for first render) or componentDidUpdate (for subsequent renders).

Defined by ReactiveMixin

[internal.setState](changes) method

Update the component's state by merging the specified changes on top of the existing state. If the component is connected to the document, and the new state has changed, this returns a promise to asynchronously render the component. Otherwise, this returns a resolved promise.

Parameters:

  • changes: objectthe changes to apply to the element's state

Returns: Promise - resolves when the new state has been rendered

Defined by ReactiveMixin

[internal.state] property

The component's current state.

The returned state object is immutable. To update it, invoke internal.setState.

It's extremely useful to be able to inspect component state while debugging. If you append ?elixdebug=true to a page's URL, then ReactiveMixin will conditionally expose a public state property that returns the component's state. You can then access the state in your browser's debug console.

Type: State

Defined by ReactiveMixin

items property

The current set of items drawn from the element's current state.

Type: Array.|null

Defined by ContentItemsMixin

items-changed event

Raised when the items property changes.

Defined by ContentItemsMixin

selected-index-changed event

Raised when the selectedIndex property changes.

Defined by SingleSelectionMixin

selectedIndex property

The index of the currently-selected item, or -1 if no item is selected.

Type: number

Defined by SingleSelectionMixin

selectedItem property

The currently-selected item, or null if no item is selected.

Type: Element

Defined by SingleSelectionMixin

selectFirst() method

Select the first item in the list.

Returns: Boolean True if the selection changed, false if not.

Defined by SingleSelectionMixin

selectionRequired property

True if the list should always have a selection (if it has items).

Type: boolean

Default: false

Defined by SingleSelectionMixin

selectionWraps property

True if selection navigations wrap from last to first, and vice versa.

Type: boolean

Default: false

Defined by SingleSelectionMixin

selectLast() method

Select the last item in the list.

Returns: Boolean True if the selection changed, false if not.

Defined by SingleSelectionMixin

selectNext() method

Select the next item in the list.

If the list has no selection, the first item will be selected.

Returns: Boolean True if the selection changed, false if not.

Defined by SingleSelectionMixin

selectPrevious() method

Select the previous item in the list.

If the list has no selection, the last item will be selected.

Returns: Boolean True if the selection changed, false if not.

Defined by SingleSelectionMixin