This repository has been archived by the owner on Apr 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 235
/
hiding-tests.html
132 lines (96 loc) · 3.31 KB
/
hiding-tests.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
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
<!DOCTYPE html>
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
<title>Tests for hiding/showing elements</title>
<style type="text/css">
.section {
border: 1px solid #CCC;
padding: 2em;
margin: 2em;
}
.test {
padding: 2em;
margin: 2em 0 0;
width: 300px;
background: #CCF;
-webkit-border-radius: 1em;
-moz-border-radius: 1em;
border-radius: 1em;
-webkit-box-shadow: 0 0 5px #000;
-moz-box-shadow: 0 0 5px #000;
box-shadow: 0 0 5px #000;
behavior: url(../build/PIE.htc);
}
</style>
<script type="text/javascript">
function toggleDisplay( id ) {
var el = document.getElementById( id );
el.style.display = el.style.display === 'none' ? 'block' : 'none';
}
function toggleVisibility( id ) {
var el = document.getElementById( id );
el.style.visibility = el.style.visibility === 'hidden' ? 'visible' : 'hidden';
}
</script>
</head>
<body>
<h1>Tests for hiding/showing elements</h1>
<div class="section">
<h2>Toggle display, hidden initially</h2>
<button type="button" onclick="toggleDisplay('test1')">Toggle</button>
<div class="test" id="test1" style="display:none;">
Hello PIE
</div>
</div>
<div class="section">
<h2>Toggle display, shown initially</h2>
<button type="button" onclick="toggleDisplay('test2')">Toggle</button>
<div class="test" id="test2">
Hello PIE
</div>
</div>
<div class="section">
<h2>Toggle parent display, hidden initially</h2>
<button type="button" onclick="toggleDisplay('test3')">Toggle</button>
<div id="test3" style="display:none;">
<div class="test">Hello PIE</div>
</div>
</div>
<div class="section">
<h2>Toggle parent display, shown initially</h2>
<button type="button" onclick="toggleDisplay('test4')">Toggle</button>
<div id="test4">
<div class="test">Hello PIE</div>
</div>
</div>
<div class="section">
<h2>Toggle visibility, hidden initially</h2>
<button type="button" onclick="toggleVisibility('test5')">Toggle</button>
<div class="test" id="test5" style="visibility: hidden">
Hello PIE
</div>
</div>
<div class="section">
<h2>Toggle visibility, shown initially</h2>
<button type="button" onclick="toggleVisibility('test6')">Toggle</button>
<div class="test" id="test6">
Hello PIE
</div>
</div>
<div class="section">
<h2>Toggle parent visibility, hidden initially</h2>
<button type="button" onclick="toggleVisibility('test7')">Toggle</button>
<div id="test7" style="visibility: hidden">
<div class="test">Hello PIE</div>
</div>
</div>
<div class="section">
<h2>Toggle parent visibility, shown initially</h2>
<button type="button" onclick="toggleVisibility('test8')">Toggle</button>
<div id="test8">
<div class="test">Hello PIE</div>
</div>
</div>
</body>
</html>