-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
58 lines (47 loc) · 1.61 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
48
49
50
51
52
53
54
55
56
57
58
// hero
const swiper = new Swiper('.swiper-container', {
slidesPerView: 1,
loop: false,
pagination: {
el: '.swiper-pagination',
clickable: true
},
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
},
});
document.addEventListener('DOMContentLoaded', function () {
//burger-menu
document.querySelector('#burger').addEventListener('click', function () {
document.querySelector('#burger').classList.toggle('active')
document.querySelector('#menu').classList.toggle('is-active')
});
// search
document.querySelector('#search__btn').addEventListener('click', function () {
document.querySelector('.form__search').classList.add('active')
});
document.querySelector('#closed__btn').addEventListener('click', function () {
document.querySelector('.form__search').classList.remove('active')
});
// how we work
document.querySelectorAll('.tabs-nav__btn').forEach(function (tabsBtn) {
tabsBtn.addEventListener('click', function (event) {
const path = event.currentTarget.dataset.path;
document.querySelectorAll('.tabs-nav__btn').forEach(function (btn) {
btn.classList.remove('tabs-nav__btn--active')
});
event.currentTarget.classList.add('tabs-nav__btn--active');
document.querySelectorAll('.tabs-item').forEach(function (tabsItem) {
tabsItem.classList.remove('tabs-item--active')
});
document.querySelector(`[data-target="${path}"]`).classList.add('tabs-item--active');
});
});
});
// frequently asked questions
$( function() {
$( ".accordion" ).accordion({
heightStyle: "content"
});
} );