forked from beejayarts/venMail
-
Notifications
You must be signed in to change notification settings - Fork 0
/
scripts.js
41 lines (32 loc) · 791 Bytes
/
scripts.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
const mobMenu = document.getElementById("mobile_menuID");
// toggle accordion button
const handleAccordion = (n) => {
let elem = `accordion${n}`;
document.getElementById(elem).classList.toggle("show");
};
// OPEN & CLOSE MOBILE MENU
const closeMobileMenu = () => {
mobMenu.style.display = "none";
};
const openMobileMenu = () => {
mobMenu.style.display = "block";
};
// swiper js
var swiper = new Swiper(".mySwiper", {
pagination: {
el: ".swiper-pagination",
},
});
// scroll to top btn
var btn = $("#toTopBtn");
$(window).scroll(function () {
if ($(window).scrollTop() > 300) {
btn.addClass("show");
} else {
btn.removeClass("show");
}
});
btn.on("click", function (e) {
e.preventDefault();
$("html, body").animate({ scrollTop: 0 }, "300");
});