-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
28 lines (23 loc) · 862 Bytes
/
script.js
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
document.addEventListener('DOMContentLoaded', function() {
var overlay = document.getElementById('overlay');
overlay.addEventListener('click', toggleoverlay);
document.querySelectorAll('.gallerypic').forEach(item => {
item.addEventListener('click', picclick)
})
function picclick(e){
var name = e.originalTarget.attributes.src.value;
var namelen = name.length;
console.log(name);
var newname = name.slice(0,namelen-4) + "L" + name.slice(namelen-4, namelen);
console.log(newname);
document.getElementById('fullscreenpic').attributes.src.value = newname;
toggleoverlay();
}
function toggleoverlay(){
if (overlay.style.display == "flex") {
overlay.style.display="none";
} else {
overlay.style.display="flex";
}
}
});