-
Notifications
You must be signed in to change notification settings - Fork 0
/
展示.html
236 lines (212 loc) · 5.78 KB
/
展示.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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>图片切换</title>
</head>
<style>
* {
box-sizing: border-box;
margin: 0;
}
/*背景当然得选鬼刀啦*/
body{
background: url(img/11.png) no-repeat;
background-size: cover;
}
/*第一页小图片的样式*/
.pictureIndex,.IndexCol {
padding:20px;
}
/*小图片的样式*/
.IndexCol {
float: left;
width: 25%;
}
/* 弹窗背景 */
.modal {
display: none;
position: fixed;
/*z-index: 1;*/
padding-top: 100px;
left: 0;
top: 0;
width: 100%;
height: 100%;
overflow: auto;
background-color: black;
}
/* 弹窗内容 */
.modal-content {
position: relative;
background-color: #fefefe;
margin: auto;
padding: 0;
width: 90%;
max-width: 1200px;
}
/* 关闭按钮 */
.close {
color: white;
position: absolute;
top: 10px;
right: 25px;
font-size: 55px;
}
/*为关闭按钮添加一些样式,更加生动一些*/
.close:hover,
.close:focus {
color: #999;
text-decoration: none;
}
/* 上一页 & 下一页 按钮 */
.prev,.next {
position: absolute;
top: 50%;
width: auto;
padding: 16px;
margin-top: -50px;
color: white;
font-weight: bold;
font-size: 50px;
transition: 0.6s;
}
/* 定位下一页按钮到右侧 */
.next {
right: 0;
}
/* 鼠标移动上去修改背景色为黑色,后面那个0.8是透明度 */
.prev:hover,.next:hover {
background-color: rgba(0, 0, 0, 0.8);
}
img {
margin-bottom: -5px;
}
/*点击后底部图片设置透明度为0.5*/
.bottomPic {
opacity: 0.5;
}
/*然后鼠标移入就取消透明度*/
.active,.bottomPic:hover {
opacity: 1;
}
/*为第一个页面的图片设置一个鼠标移入显示黑边的效果*/
.hover-shadow:hover {
box-shadow: 0 5px 10px 0 rgba(0, 0, 0, 0.8)
}
</style>
<body>
<h1 style="text-align:center;color: navajowhite;">由于那些图片显示模糊,为了观赏性故用一些图片取而代之</h1>
<div class="pictureIndex">
<div class="IndexCol">
<img src="img/3.png" style="width:100%" onclick="openShow();currentSlide(1)" class="hover-shadow">
</div>
<div class="IndexCol">
<img src="img/4.png" style="width:100%" onclick="openShow();currentSlide(2)" class="hover-shadow">
</div>
<div class="IndexCol">
<img src="img/7.png" style="width:100%" onclick="openShow();currentSlide(3)" class="hover-shadow">
</div>
<div class="IndexCol">
<img src="img/6.png" style="width:100%" onclick="openShow();currentSlide(4)" class="hover-shadow">
</div>
<div class="IndexCol">
<img src="img/1.png" style="width:100%" onclick="openShow();currentSlide(5)" class="hover-shadow">
</div>
<div class="IndexCol">
<img src="img/15.png" style="width:100%" onclick="openShow();currentSlide(6)" class="hover-shadow">
</div>
<div class="IndexCol">
<img src="img/2.jpg" style="width:100%" onclick="openShow();currentSlide(7)" class="hover-shadow">
</div>
<div class="IndexCol">
<img src="img/1.jpg" style="width:100%" onclick="openShow();currentSlide(8)" class="hover-shadow">
</div>
</div>
<div id="myModal" class="modal">
<span class="close" onclick="closeShow()">×</span>
<div class="modal-content">
<div class="mySlides">
<img src="img/3.png" style="width:100%">
</div>
<div class="mySlides">
<img src="img/4.png" style="width:100%">
</div>
<div class="mySlides">
<img src="img/7.png" style="width:100%">
</div>
<div class="mySlides">
<img src="img/6.png" style="width:100%">
</div>
<div class="mySlides">
<img src="img/1.png" style="width:100%">
</div>
<div class="mySlides">
<img src="img/15.png" style="width:100%">
</div>
<div class="mySlides">
<img src="img/2.jpg" style="width:100%">
</div>
<div class="mySlides">
<img src="img/1.jpg" style="width:100%">
</div>
<a class="prev" onclick="move(-1)">❮</a>
<a class="next" onclick="move(1)">❯</a>
<div class="IndexCol">
<img class="bottomPic" src="img/3.png" style="width:100%" onclick="currentSlide(1)">
</div>
<div class="IndexCol">
<img class="bottomPic" src="img/4.png" style="width:100%" onclick="currentSlide(2)">
</div>
<div class="IndexCol">
<img class="bottomPic" src="img/7.png" style="width:100%" onclick="currentSlide(3)">
</div>
<div class="IndexCol">
<img class="bottomPic" src="img/6.png" style="width:100%" onclick="currentSlide(4)">
</div>
<div class="IndexCol">
<img class="bottomPic" src="img/1.png" style="width:100%" onclick="currentSlide(5)">
</div>
<div class="IndexCol">
<img class="bottomPic" src="img/15.png" style="width:100%" onclick="currentSlide(6)">
</div>
<div class="IndexCol">
<img class="bottomPic" src="img/2.jpg" style="width:100%" onclick="currentSlide(7)">
</div>
<div class="IndexCol">
<img class="bottomPic" src="img/1.jpg" style="width:100%" onclick="currentSlide(8)">
</div>
</div>
</div>
</body>
<script>
var slideIndex = 1;
function openShow() {
document.getElementById('myModal').style.display = "block";
}
function closeShow() {
document.getElementById('myModal').style.display = "none";
}
function move(n) {
showSlides(slideIndex += n);
}
function currentSlide(n) {
showSlides(slideIndex = n);
}
function showSlides(n) {
var i;
var slides = document.getElementsByClassName("mySlides");
var dots = document.getElementsByClassName("bottomPic");
if (n > slides.length) {slideIndex = 1}
if (n < 1) {slideIndex = slides.length}
for (i = 0; i < slides.length; i++) {
slides[i].style.display = "none";
}
for (i = 0; i < dots.length; i++) {
dots[i].className = dots[i].className.replace("active","");
}
slides[slideIndex-1].style.display = "block";
dots[slideIndex-1].className += " active";
}
</script>
</html>