Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var c = 1;
- function progressUpdate(max, min, _callback){
- if (c == 0) {
- console.log(c);
- _callback();
- } else if (c == 1) {
- t = setTimeout(function() {
- CurrentProgress = min + 1;
- progressUpdate(max, CurrentProgress);
- console.log(CurrentProgress);
- if (CurrentProgress >= max) {
- CurrentProgress = max;
- clearTimeout(t);
- t = 0;
- c = 0;
- progressUpdate(max, CurrentProgress);
- }
- },100);
- }
- }
- progressUpdate(2, 0, function() {
- alert("test");
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement