-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhelper.js
More file actions
40 lines (35 loc) · 1.17 KB
/
helper.js
File metadata and controls
40 lines (35 loc) · 1.17 KB
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
$(document).ready(function () {
$('#icon').click(function () {
$('.unorder_list').toggleClass('show');
});
});
$("#navigation").load("navigation.html",);
$("#footer").load("footer.html",);
function readMore(city) {
let dots = document.querySelector(`.card[data-city="${city}"] .dots`);
let moreText = document.querySelector(`.card[data-city="${city}"] .more`);
let btnText = document.querySelector(`.card[data-city="${city}"] .myBtn`);
if (dots.style.display === "none") {
dots.style.display = "inline";
btnText.textContent = "Read more";
moreText.style.display = "none";
} else {
dots.style.display = "none";
btnText.textContent = "Read less";
moreText.style.display = "inline";
}
}
// FAQ
const acc = document.getElementsByClassName("accordion");
let i;
for (i = 0; i < acc.length; i++) {
acc[i].addEventListener("click", function () {
this.classList.toggle("faqs");
const panel = this.nextElementSibling;
if (panel.style.maxHeight) {
panel.style.maxHeight = null;
} else {
panel.style.maxHeight = panel.scrollHeight + "px";
}
});
}