-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
43 lines (42 loc) · 1.19 KB
/
index.html
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
<!DOCTYPE html>
<html>
<head>
<title>Hades's project</title>
</head>
<body>
<h3 id="content">let's try something with github!</h3><span></span>
<button id="start" onclick="start()"> S t a r t - C l i c k </button>
<button id="end" onclick="end()" disabled="disabled"> E n d - C l i c k </button>
</body>
<script>
function GetRandomNum(Min,Max)
{
var Range = Max - Min;
var Rand = Math.random();
return(Min + Math.round(Rand * Range));
}
var k = 0;
var int = '';
var color = ['red','green','blue','yellow','gray','azure','khaki','gold','silver','brown','pink','palegoldenrod','palegreen','palevioletred','peachpuff','camel','maroon','scarlet','plum','rosybrown','rubine','seagreen','stone','wheat'];
function bilibili(){
var obj = document.getElementById('content');
var length = color.length;
obj.style="color:"+color[k];
if(k >= length-1){
k=0;
}else{
k++;
}
}
function start(){
int = setInterval("bilibili()",30);
document.getElementById('start').disabled = 'disabled';
document.getElementById('end').disabled = '';
}
function end(){
int=window.clearInterval(int);
document.getElementById('start').disabled = '';
document.getElementById('end').disabled = 'disabled';
}
</script>
</html>