Slider.addItem

Syntax

addItem(value: Number);

Parameters

value. Starting value of the slider.

Description

The addItem method adds a new slider on the Slider component.

Example

To execute the example, the page must contain the Slider component named slider (see Example of Creating the Slider Component). Block component refreshing, add a new slider and a label, color the component axis with green color, unblock refreshing for the component and refresh it:

// Block component refreshing
slider.beginUpdate()
// Determine a brush
var brush = new PP.SolidColorBrush({
    Color: "#00ff00"
});
// Add a new slider with the 0.5 value
slider.addItem(0.5);
// Add a new label
slider.addTick(2004);
// Fill component axis with the color of selected brush
slider.fillAxis(brush);
// Unblock component refreshing and refresh it
slider.endUpdate()

After executing the example a new slider and label are added, component axis is colored in green, and the component is refreshed:

See also:

 Slider