-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbundle.js
57 lines (43 loc) · 1.3 KB
/
bundle.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
55
56
57
$(function(){
$('.navbar__toggle-navbar').on('click', function(){
$('.navbar__menu-block').toggleClass('active');
});
$('.navbar__menu-link').on('click', function(){
$('.navbar__menu-block').toggleClass('active');
});
})
$(document).keyup(function (e) {
if (e.keyCode === 27) {
$('.navbar__menu-block').removeClass('active');
}
});
//navbar links: scrolling to anchors
$(function () {
function slowScroll (e) {
let anchor = $(this);
$('html, body').stop().animate({
scrollTop: $(anchor.attr('href')).offset().top - -10
}, 800);
e.preventDefault();
}
$('a.navbar__menu-link').on("click", slowScroll);
$('a.footer-nav__link').on("click", slowScroll);
})
let slideIndex = 1;
showSlides(slideIndex);
function plusSlides(n) {
showSlides(slideIndex += n);
}
function showSlides(n) {
let slides = document.getElementsByClassName("slidershow-container__mySlides");
if (n > slides.length) {
slideIndex = 1;
}
if (n < 1) {
slideIndex = slides.length;
}
for (let i = 0; i < slides.length; i++) {
slides[i].style.display = "none";
}
slides[slideIndex-1].style.display = "block";
}