-
Notifications
You must be signed in to change notification settings - Fork 0
/
image_model.html
136 lines (109 loc) · 3.33 KB
/
image_model.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
.img {
width: 10%;
}
.modal {
display: none;
position: fixed;
z-index: 1;
left: 0;
top: 0;
width: 100%;
height: 100%;
padding-top: 100px;
overflow: auto;
background-color: rgb(0, 0, 0);
background-color: (rgba(0, 0, 0, .9));
}
.modal-img {
display: block;
width: 80%;
max-width: 700px;
margin: auto;
}
.model-img {
animation-name: zoom;
animation-duration: 0.6s;
}
@keyframes zoom {
from {
transform: scale(.1)
}
to {
transform: scale(1)
}
}
.close {
position: absolute;
top: 15px;
right: 35px;
font-size: 40px;
font-weight: bold;
color: #f1f1f1;
transition: .3s;
}
.close:hover,
.close:foces {
color: #bbb;
cursor: pointer;
text-decoration: none;
}
</style>
</head>
<body>
<div id="" class="container">
<figure id="" class="">
<img id="" class="img" src="./images/1.jpg" alt="">
<figcaption id="" class="">Image - 1</figcaption>
</figure>
<!-- <figure id="" class="">
<img id="" class="img" src="./images/1.jpg" alt="">
<figcaption id="" class="">Image - 1</figcaption>
</figure>
<figure id="" class="">
<img id="" class="img" src="./images/1.jpg" alt="">
<figcaption id="" class="">Image - 1</figcaption>
</figure>
<figure id="" class="">
<img id="" class="img" src="./images/1.jpg" alt="">
<figcaption id="" class="">Image - 1</figcaption>
</figure> -->
</div>
<div class="modal">
<span class="close">×</span>
<img id="" class="modal-img" src="./images/1.jpg" alt="">
<div class="caption"></div>
</div>
<script>
console.log("eda");
var fig_container = document.querySelectorAll(".container");
var modal = documnet.getElementsByClassName("modal");
var img = document.getElementsByClassName("img");
var figure = document.getElementsByTagName("figure");
var modal_img = document.getElementsByClassName("modal-img");
var close_btn = documnet.getElementsByClassName("close");
// fig_container.foreach(function (node) {
// console.log(node);
// node.addEventListener("click", function () {
// modal.style.display = "block";
// modal_img.src = this[1].src;
// });
// });
figure.onclick = function () {
console.log("slm");
// modal.style.display = "block";
// modal_img.src = this.src;
}
close_btn.onclick = function () {
modal.style.display = "none";
}
</script>
</body>
</html>