-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
44 lines (37 loc) · 1.08 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
const menu = document.getElementById("menu");
const sidebar = document.querySelector(".header-right");
menu.addEventListener("click", () => {
sidebar.classList.toggle("active");
console.log("clicked");
});
document.addEventListener("DOMContentLoaded", function() {
var swiper = new Swiper('.swiper-container', {
slidesPerView: '3',
spaceBetween: 0,
loop: true,
autoplay: {
delay: 0,
stopOnLastSlide: false,
waitForTransition: true,
},
speed: 10000,
grabCursor: true,
freemode: true,
breakpoints: {
0: {
speed: 5000,
},
1200: {
speed: 5000,
}
}
});
// Pause on hover
const swiperSlide = document.querySelector('.swiper-slide');
swiperSlide.addEventListener('mouseenter', function() {
swiper.autoplay.stop();
});
swiperSlide.addEventListener('mouseleave', function() {
swiper.autoplay.start();
});
});