-
Notifications
You must be signed in to change notification settings - Fork 0
/
jsfile.js
51 lines (41 loc) · 999 Bytes
/
jsfile.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
var min=0,sec=0,mill=0, t;
var sp=" : ";
var c1,c2,c3;
function func2(){
clearInterval(t);
}
function func3(){
t = setInterval(function() { func5() } , 10);
document.getElementById('st').disabled = true;
}
function func5()
{
mill++;
if(mill >= 99)
{
mill = 0;
sec++;
if(sec >= 59)
{
sec = 0;
min++;
}
}
var x = document.body;
c1 = Math.floor(Math.random() * 256);
c2 = Math.floor(Math.random() * 256);
c3 = Math.floor(Math.random() * 256);
// c1 = "f" + Math.trunc(Math.random()*9) ;
// c2 = "f" + Math.trunc(Math.random()*9) ;
// c3 = "f" + Math.trunc(Math.random()*9) ;
x.style.backgroundColor = "rgb(" + c1 + "," + c2 + "," + c3 + ")";
document.getElementById('a').innerHTML = min + sp + sec + sp + mill;
}
function func4()
{
document.getElementById('st').disabled = false;
min = "00";
sec = "00";
mill = "00";
document.getElementById('a').innerHTML = min + sp + sec + sp + mill;
}