forked from ni-ccc/ni-ccc.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathimg.js
More file actions
23 lines (18 loc) · 637 Bytes
/
Copy pathimg.js
File metadata and controls
23 lines (18 loc) · 637 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
function makeImgsClickable() {
let imgs = document.getElementsByTagName("img");
for(let i of imgs) {
i.onclick = () => {
let s = document.getElementsByTagName("body")[0];
let frame = document.createElement('div');
frame.classList.add('img-frame');
frame.onclick = () => {
frame.parentElement.removeChild(frame);
}
let image = document.createElement('img');
image.src = i.src;
frame.appendChild(image);
s.appendChild(frame);
}
i.classList.add("clickable");
}
};