getItemById(id: String);
id. Identifier of the returned slider.
The getItemById method gets a slider of the Slider component by specified ID.
The method returns value of the PP.Ui.SliderItem type.
To execute the example, the page must contain the Slider component named slider (see Example of Creating the Slider Component). Get slider by its identifier, and display width and height values for the slider:
// Get slider by identifier var item = slider.getItemById("SliderItem1"); // Display width and height values for the slider console.log("Slider width: " + item.getWidth() + ", slider height: " + item.getHeight());
After executing the example the browser console displays width and height for the received slider:
Slider width: 25, slider height: 15
See also: