1 | /** |
先看效果
demo的文件结构图
你需要下载Jqueryjquery-3.2.1.js
-jQuery+原生的javascript实现导航
-css
-demo.css
-js
-demo.js
-jquery-3.2.1.js
-images
-1.png
-2.jpg
-3.jpg
-4.png
-5.png
-demo.html
界面原型
demo.html
1 |
|
##样式
css/demo.css1
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* {
margin:0px;
padding: 0px;
}
body {
font-size: 12px;
line-height: 1.7;
}
li {
list-style: none;
}
#content {
width: 800px;
margin: 0 auto;
padding: 20px;
}
#content h1 {
color: red;
}
#content .item {
padding: 20px;
margin-bottom: 20px;
border: 1px dotted red;
}
#content .item h2 {
font-size: 16px;
font-weight: bold;
border-bottom: 2px solid red;
margin-bottom: 10px;
}
#content .item li{
display: inline;
margin-right: 10px;
}
#content .item li a img {
width: 230px;
height: 230px;
border: none;
}
#menu {
position: fixed;
top: 100px;
left: 50%;
margin-left: 400px;
width: 80px;
}
#menu ul li a{
display: block;
margin: 5px 0;
font-size: 14px;
font-weight: bold;
color: #333;
width: 80px;
height:50px;
line-height: 50px;
text-decoration: none;
text-align:center;
}
#menu ul li a:hover,
#menu ul li a.current{
color: #ffffff;
background: red;
}
动作操作
js/demo.js
1 | /** |