PP.Ui.ProgressBar (settings);
settings. JSON object that contains values of component properties.
The ProgressBar constructor creates an instance of the ProgressBar component.
To execute the example, in the HEAD tag add links to PP.js component library and to PP.css visual styles. In the BODY tag add a DIV element with the identifier progressBar. In the SCRIPT tag add component creation code:
//the ProgressBar component var progressBar = new PP.Ui.ProgressBar( { ParentNode: document.getElementById("progressBar"), Width: 200, Height: 20, //component is placed horizontally IsVertical: false, //value is shown DisplayValue: true, //value is determined ignoring thousandths IsPrecision: false, //initial value Value: 10 }); var inc = 1; //interval of the function execution go() - half of a second setInterval('go()', 500); //function of the ProgressBar component value change function go() { var cur = progressBar.getValue(); if (cur >= 100 || cur <= 0) { inc *= -1; } progressBar.setValue(cur + (2 * inc)); }
After executing the example, the ProgressBar component is placed in the page. Component value changes by two every half second (increases if the value is greater than 100, and decreases if it less than 100):
See also: