-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
54 lines (42 loc) · 1.47 KB
/
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
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
// const scroll = new LocomotiveScroll({
// el: document.querySelector('#main'),
// smooth: true
// });
function page3(){
var elemC = document.querySelector("#elem-container")
elemC.addEventListener("mouseenter",function(){
document.querySelector('#fixed-image').style.display='block'
})
elemC.addEventListener("mouseleave",function(){
document.querySelector('#fixed-image').style.display='none'
})
var elems = document.querySelectorAll(".elem")
elems.forEach(function(e){
e.addEventListener("mouseenter",()=>{
let img= e.getAttribute("data-image")
document.querySelector('#fixed-image').style.backgroundImage=`url(${img})`;
})
})
}
function nav__link(){
var a = document.querySelectorAll(".nav__link ");
a.forEach(a=>{
a.addEventListener('click',()=>{
document.querySelector('.active')?.classList.remove('active');
a.classList.add('active');
document.querySelector('#data-entry').innerHTML=a.getAttribute("data");
let img= a.getAttribute("img")
document.querySelector('#DPE #right').style.backgroundImage=`url(${img})`;
})
})
}
function swiperAnimation(){
var swiper = new Swiper(".mySwiper", {
slidesPerView: "auto",
centeredSlides: true,
spaceBetween: 100,
});
}
page3();
nav__link();
swiperAnimation();