Advertisement
McFree

Untitled

Apr 11th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var progressBar = null;            
  2. for (var i = 0; i <= 100; i ++) {
  3.     progressBar = new ProgressBar();
  4.     progressBar.label = "Progress: "+i+"%";
  5.     progressBar.appendTo(document.querySelector(".container"));
  6.     progressBar.setValue(i);
  7. }
  8.    
  9. var value = 0, direction = false, step = 1;
  10.                    
  11. progressBar = new ProgressBar();
  12. progressBar.label = "Live";
  13. progressBar.appendTo(document.querySelector(".container"));
  14.                    
  15. var intv = window.setInterval(function() {
  16.     if (direction) {
  17.         value -= step;
  18.     } else {
  19.         value += step;
  20.     }          
  21.     progressBar.setValue(value);           
  22.     if (value >= 100 || (value <= 0 && direction))
  23.         direction = !direction;
  24. },33);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement