-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
29 lines (25 loc) · 802 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
29
let i=2;
function next() {
i++;
loader();
const imageElement = document.querySelector('#image img');
imageElement.setAttribute("src",`./assets/2 (${i}).jpg`);
}
function previous() {
i--;
loader();
const imageElement = document.querySelector('#image img');
imageElement.setAttribute("src",`./assets/2 (${i}).jpg`);
}
function loader() {
const loader = document.querySelector('.loader');
const div = document.querySelector('#image');
div.style.display = 'none';
loader.style.display = 'block';
document.querySelector('body').classList.add('modal-screen');
setTimeout(() => {
loader.style.display = 'none';
div.style.display = 'block';
document.querySelector('body').classList.remove('modal-screen');
}, 1200);
}