-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjrsArt.js
63 lines (63 loc) · 1.67 KB
/
jrsArt.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
var numOfCircles = 0;
function move() {
$("#pourcentage").html("");
$("#cent-pourcent").css("display","");
$("#cicle-loader").css("display","none");
var fullBar;
var moreContent;
var firstLoop = true;
var i = 0;
var id;
var id2;
var id3;
var stall = (Math.random() * 25);
stall = Math.round(stall);
var stallCnt = (Math.random() * 10);
stallCnt = Math.round(stallCnt);
if (i == 0) {
i = 1;
var elem = document.getElementById("pourcentage");
var width = 0;
id = setInterval(frame, 50);
function frame() {
clearTimeout(fullBar);
clearInterval(moreContent);
if (width >= 100) {
clearInterval(id);
clearInterval(id2);
clearInterval(id3);
i = 0;
$("#pourcentage-chiffre").html(width + "% Complete");
fullBar = setTimeout(function() {
width = 0;
moreContent = setInterval(function() {
if(firstLoop) {
$("#cent-pourcent").css("display","none");
$("#circle-loader-" + numOfCircles).css("display","");
numOfCircles++;
}
else {
firstLoop = true;
elem.style.width = width + "%";
$("#pourcentage-chiffre").html("Load More Content Now");
$("#cent-pourcent").css("display","");
clearInterval(moreContent);
}
firstLoop = false;
}, 1500); // 1500
}, 250);
} else {
width++;
if(width == stall) {
clearInterval(id);
id2 = setInterval(frame, 1111); //1111
} else if(width == stall + stallCnt) {
clearInterval(id2);
id3 = setInterval(frame, 10);
}
elem.style.width = width + "%";
$("#pourcentage-chiffre").html(width + "% Complete");
}
}
}
}