-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
94 lines (63 loc) · 1.54 KB
/
index.html
File metadata and controls
94 lines (63 loc) · 1.54 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>JavaScript | ToogleMenu</title>
<style>
#cpBtn{
position: fixed;
width:20px;
height: 21px;
background: linear-gradient(#fff, #ddd);
border: 1px solid #aaa;
border-radius: 2px;
cursor:pointer;
padding: 2px 5px;
transition: all 0.5s;
}
#cpBtn:hover{
border: 1px solid #000;
}
#cpBtn div{
width: 20px;
height: 3px;
background: #777;
margin: 3px 0;
border-radius: 4px;
transition: all 0.5s;
}
#cpBtn:hover div{
background:#000;
}
#cp{
width: 200px;
background: #333;
position: absolute;
left: -200px;
top: 45px;
transition: all 0.5s;
}
</style>
</head>
<body>
<div id="cpBtn" onclick="toogleCp()">
<div></div>
<div></div>
<div></div>
</div>
<div id="cp">
</div>
<script>
function toogleCp(){
var cp = document.getElementById("cp");
cp.style.height = window.innerHeight - 90+"px";
if(cp.style.left == "0px"){
cp.style.left = "-200px";
}
else{
cp.style.left = "0px";
}
}
</script>
</body>
</html>