-
Notifications
You must be signed in to change notification settings - Fork 3
/
toggleSlider.html
executable file
·52 lines (51 loc) · 1.1 KB
/
toggleSlider.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<link rel="stylesheet" href="../css/style.css" >
</head>
<style>
#wrap {
height: 200px;
width: 200px;
border: 1px solid #ccc;
}
#slider {
overflow-y: hidden;
max-height: 200px;
-webkit-transition: all .5s cubic-bezier(0, 1, 0.5, 1);
transition: all .5s cubic-bezier(0, 1, 0.5, 1);
background: pink;
height: inherit;
width: inherit;
}
#toggle {
display: none;
}
#toggle + label {
padding: 1px 6px;
text-align: center;
border-radius: 2px;
background: rgb(221, 221, 221);
border: 1px outset buttonface;
margin-bottom: 2px;
display: inline-block;
cursor: pointer;
}
/* most important part is here: */
#toggle:checked ~ #wrap > #slider {
max-height: 0;
}
</style>
<body>
<h1><mark>PURE CSS</mark> Slide Up and Slide Down</h1>
<input id="toggle" type="checkbox"><label for="toggle">toggle slider</label>
<div id="wrap">
<div id="slider">
<p>Blah blah blah blah blah....</p>
</div>
</div>
</div>
</body>
</html>