-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
47 lines (39 loc) · 1.15 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
const scroll = new LocomotiveScroll({
el: document.querySelector('#main'),
smooth: false
});
var a = document.querySelector("#elem1")
var b = a.getAttribute("data-image")
console.log(b)
console.log("hey hii")
var ab = document.querySelector("#elem-container")
var g = document.querySelector("#fixed-image")
ab.addEventListener("mouseenter",function(){
g.style.display = "block"
})
ab.addEventListener("mouseleave",function(){
g.style.display= "none"
})
var elems = document.querySelectorAll(".elem")
elems.forEach(function(e){
e.addEventListener("mouseenter",function(){
var image = e.getAttribute("data-image")
g.style.backgroundImage = `url(${image})`
})
})
function swiperAnimation() {
var swiper = new Swiper(".mySwiper", {
slidesPerView: "3",
centeredSlides: false,
spaceBetween: 120,
pagination: {
el: ".swiper-pagination",
type: "progressbar",
},
navigation: {
nextEl: ".swiper-button-next",
prevEl: ".swiper-button-prev",
},
});
}
swiperAnimation();