-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHover Game Advanced
92 lines (85 loc) · 2.85 KB
/
Hover Game Advanced
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<html>
<head>
<style>
.a{
display:inline;
background-color: blue;
color: blue;
width: 100px;
float: left;
}
.b{
display:inline;
background-color: red;
color: red;
width: 100px;
float: left;
}
h1:hover{
background-color: white!important;
color: white!important;
}
.a::selection{
display:inline;
background-color: blue;
color: blue;
width: 100px;
float: left;
}
.b::selection{
display:inline;
background-color: red;
color: red;
width: 100px;
float: left;
}
</style>
</head>
<body>
<div id="div" class="div">
</div>
<script>
for(var i = 1;i<10;i){
var a = document.createElement('h1')
document.getElementById('div').appendChild(a)
a.innerHTML=("HI")
a.id="id"
document.getElementById("id").setAttribute('class', 'a');
a.id=null
a.href=""
i=i+1
var b = document.createElement('h1')
document.getElementById('div').appendChild(b)
b.innerHTML=("BYE")
b.id="id"
document.getElementById("id").setAttribute('class', 'b');
b.id=null
b.href=""
i=i+1
}
for(i=1;i<10000;i){
setTimeout(function(){
document.getElementsByClassName('a')[0].setAttribute("style","background-color:red;color:red")
Array.prototype.forEach.call(document.getElementsByClassName('a'),
item => item.setAttribute("style","color: blue;background-color:blue"));
},(2*i-0)*1000)
setTimeout(function(){
document.getElementsByClassName('a')[0].setAttribute("style","background-color:blue;color:blue")
Array.prototype.forEach.call(document.getElementsByClassName('a'),
item => item.setAttribute("style","color: red;background-color:red"));
},(2*i-1)*1000)
setTimeout(function(){
document.getElementsByClassName('b')[0].setAttribute("style","background-color:blue;color:blue")
Array.prototype.forEach.call(document.getElementsByClassName('b'),
item => item.setAttribute("style","color: blue;background-color:blue"));
},(2*i-1)*1000)
setTimeout(function(){
document.getElementsByClassName('b')[0].setAttribute("style","background-color:red;color:red")
Array.prototype.forEach.call(document.getElementsByClassName('b'),
item => item.setAttribute("style","color: red;background-color:red"));
},(2*i-0)*1000)
i=i+1
}
</script>
</body>
</html>