-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscripts.js
38 lines (34 loc) · 1.23 KB
/
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
// Accordion for FAQ Section
document.addEventListener('DOMContentLoaded', function() {
const accordionItems = document.querySelectorAll('.accordion-item');
accordionItems.forEach(item => {
item.addEventListener('click', function() {
const content = this.querySelector('.accordion-content');
const allContents = document.querySelectorAll('.accordion-content');
// Close other accordion items
allContents.forEach(c => {
if (c !== content) {
c.style.display = 'none';
}
});
// Toggle the clicked item
if (content.style.display === 'block') {
content.style.display = 'none';
} else {
content.style.display = 'block';
}
});
});
});
// Button Hover Effect
document.addEventListener('DOMContentLoaded', function() {
const buttons = document.querySelectorAll('.btn');
buttons.forEach(button => {
button.addEventListener('mouseover', () => {
button.style.transform = 'scale(1.05)';
});
button.addEventListener('mouseout', () => {
button.style.transform = 'scale(1)';
});
});
});