-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
37 lines (32 loc) · 964 Bytes
/
index.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
const navList = document.getElementById("navList");
const toggleBtn = document.getElementById("toggleBtn");
// navList.style.display = "block"; // Hide the navList initially
toggleBtn.addEventListener("click", () => {
if (navList.style.display === "none") {
navList.style.display = "block"; // Show the navList when button is clicked
} else {
navList.style.display = "none"; // Hide the navList when button is clicked again
}
});
// Add this code to handle page refresh
window.addEventListener("load", () => {
navList.style.display = "none"; // Ensure navList is hidden on page load
});
const swiper = new Swiper(".swiper", {
// Optional parameters
direction: "horizontal",
loop: true,
// If we need pagination
pagination: {
el: ".swiper-pagination",
clickable: true,
},
autoplay: {
delay: 2500,
disableOnInteraction: false,
},
// And if we need scrollbar
scrollbar: {
el: ".swiper-scrollbar",
},
});