Slider.removeItemByIndex

Syntax

removeItemByIndex(index: Number);

Parameters

index. Index of the slider to remove.

Description

The removeItemByIndex method removes a slider of the Slider component with specified index.

Example

To execute the example, the page must contain the Slider component named slider (see Example of Creating the Slider Component). Add a new slider, remove sliders with the index 0 and the ID SliderItem2, remove label with the index 0:

// Add a new slider with the 0.5 slider
slider.addItem(0.5);
// Remove slider with the SliderItem2 identifier
slider.removeItemById("SliderItem2");
// Remove the slider with the 0 index
slider.removeItemByIndex(0);
// Remove tick mark with the 0 index
slider.removeTickByIndex(0);

After executing the example a new slider is added to the component's center, sliders with the index 0 and the ID SliderItem2 are removed, tick mark with the index 0 is also removed:

See also:

 Slider