-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathoverlay-bug-fixed.html
46 lines (44 loc) · 1.06 KB
/
overlay-bug-fixed.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
44
45
46
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, minimum-scale=1">
<style>
html, body {
margin: 0px;
height: 100%;
width: 100%;
background: repeating-linear-gradient(
45deg,
red,
red 30px,
blue 30px,
blue 60px);
}
.invisible {
display: none;
}
#overlay {
background-color: #030303;
position: fixed;
width: 100%;
height: 100%;
}
#content {
width: 100%;
height: 500%;
}
</style>
<script>
addEventListener('click', function() {
var invisible = document.getElementsByClassName('invisible')[0];
var visible = document.getElementsByClassName('visible')[0];
visible.className = 'invisible';
invisible.className = 'visible';
});
</script>
</head>
<body>
<div id="overlay" class="invisible"></div>
<div id="content" class="visible"><h2>Click or tap to show/hide overlay</h2></div>
</body>
</html>