-
Notifications
You must be signed in to change notification settings - Fork 0
/
img.html
76 lines (66 loc) · 1.75 KB
/
img.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
<!DOCTYPE html>
<!-- <script>
window.navigator.appVersion.indexOf('Trident') != -1 && alert('Please use Google Chrome or Firefox!');
</script> -->
<html>
<head>
<meta charset="utf-8">
<title></title>
<style type="text/css">
* {
margin: 0;
}
body {
padding: 0px 0;
overflow-x: hidden;
}
.wrap {
display: flex;
flex-wrap: wrap;
}
.wrap img {
border-radius: 10px;
margin: 5px;
/* padding: 5px; */
height: 256px;
background: #777;
flex-grow: 1;
object-fit: cover;
transition: .3s;
}
.wrap:after {
display: block;
content: '';
flex-grow: 9999;
}
.wrap img:hover {
border-radius: 0px;
transform: scale(1.2);
box-shadow: 0 0 20px #fff;
z-index: 9999;
}
</style>
</head>
<body>
<div class="wrap"></div>
<script>
var wrap = document.querySelector('.wrap');
var src = ["Untitled.png"];
for (var i = 0; i < src.length; i++) {
let a = document.createElement('a');
let img = document.createElement('img');
img.id = 'imgno' + i;
img.src = src[i];
wrap.appendChild(a);
a.appendChild(img);
a.href = img.src;
// img.addEventListener("click", () => {
// let img2 = document.getElementById(img.id);
// alert(img2.src);
// });
}
</script>
<script defer>
</script>
</body>
</html>