-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
51 lines (37 loc) · 980 Bytes
/
script.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
function max(x1,x2,x3)
{
if (x1 > x2 &&x1>x3)
return x1
else if(x2>x3)
return x2
else
return x3
}
function count(end1,end2,end3)
{
cr=0
inc=1
step=setInterval(()=>{
if(cr<end1)
{
document.getElementById("count1").textContent=cr+inc+"+";
}
if(cr<end2)
{
document.getElementById("count2").textContent=cr+inc+"+";
}
if(cr<end3)
{
document.getElementById("count3").textContent=cr+inc+"+";
}
if(cr>=max(end1,end2,end3))
{
clearInterval(step)
}
cr+=inc
},45);
}
document.addEventListener("DOMContentLoaded",()=>{
count(123,542,100);
}
)