-
Notifications
You must be signed in to change notification settings - Fork 0
/
new.js
32 lines (24 loc) · 844 Bytes
/
new.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
30
31
32
let menu = document.querySelector('#menu-bar');
let navbar = document.querySelector('.navbar');
menu.onclick =() => {
menu.classList.toggle('fa-times');
navbar.classList.toggle('active');
}
let slide = document.querySelector('.slide-container');
let index = 0;
function next(){
slides[index].classList.remove('active');
index = (index + 1) % slides.length;
slides[index].classList.add('active')
}
function prev(){
slides[index].classList.remove('active');
index = (index - 1 + slides.length ) % slides.length;
slides[index].classList.add('active')
}
document.querySelectorAll('.featured-image-1').array.forEach(image_1 => {
image_1.addEventListener('click', () =>{
var src = image_1.getAttribute('src');
document.querySelector('.big-image-1').src = src
})
})