-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
117 lines (115 loc) · 2.78 KB
/
index.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
<html>
<head>
<meta charset="utf-8">
<title>javaScript-demo</title>
<style>
body, html {
height: 100%;
margin: 0;
padding: 0;
}
body {
position: relative;
}
a {
text-decoration: none;
color: #333;
}
a:visited {
color: #333;
}
a:hover {
color: #1da57a;
}
ul, li {
list-style: none;
padding: 0;
margin: 0;
}
.container {
padding: 60px;
display: flex;
justify-content: space-around;
}
.item {
padding: 20px 40px;
border: 1px solid #1da57a;
border-radius: 10px;
}
.item-title {
color: #1da57a;
line-height: 30px;
margin-bottom: 16px;
font-size: 18px;
}
.item-nav {
line-height: 38px;
}
.item-nav-active {
color: #1da57a;
}
.item-nav:hover {
cursor: pointer;
color: #1da57a;
}
.item-children-menu-hide {
height: 0;
overflow: hidden;
transition: all .3s;
}
.item-children-menu-show {
margin-bottom: 20px;
transition: all .3s;
}
</style>
</head>
<body>
<div class="container">
<div class="item">
<div class="item-title">样式档</div>
<div>
<div class="item-nav">图片拖拽</div>
<ul class="item-children-menu-hide">
<li>
<a href="./图片拖拽/canvas实现/index.html">canvas实现</a>
</li>
<li>
<a href="./图片拖拽/css实现/index.html">css实现</a>
</li>
</ul>
</div>
<div>
<div class="item-nav">
<a href="./自适应瀑布/index.html">自适应瀑布</a>
</div>
</div>
<div>
<div class="item-nav">
<a href="./css3D/index.html">css3D效果</a>
</div>
</div>
</div>
<div class="item">
<div class="item-title">js挡</div>
</div>
<div class="item">
<div class="item-title">canvas、h5</div>
</div>
</div>
</body>
<script src="https://unpkg.com/[email protected]/dist/jquery.js"></script>
<script type="text/javascript">
$('.item-nav').on('click', function() {
const children = $(this).next()
if (children.hasClass("item-children-menu-hide")) {
children.removeClass('item-children-menu-hide').addClass('item-children-menu-show')
$(this).addClass('item-nav-active')
return
}
if (children.hasClass("item-children-menu-show")) {
children.removeClass('item-children-menu-show').addClass('item-children-menu-hide')
return
}
})
</script>
</html>