-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patha.scripts.js
51 lines (43 loc) · 1.92 KB
/
a.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
42
43
44
45
46
47
48
49
50
51
document.addEventListener('DOMContentLoaded', function() {
const qaButtons = document.querySelectorAll('.qa-button');
qaButtons.forEach(button => {
button.addEventListener('click', () => {
const qaItem = button.parentElement;
const qaContent = qaItem.querySelector('.qa-content');
qaItem.classList.toggle('active');
qaContent.style.maxHeight = qaContent.style.maxHeight ? null : qaContent.scrollHeight + "px";
button.classList.toggle('active');
});
});
});
document.querySelectorAll('.qa-button').forEach(button => {
button.addEventListener('click', () => {
const content = button.nextElementSibling;
content.style.display = content.style.display === 'block' ? 'none' : 'block';
});
});
// Add more functionality to the photo slider
const leftArrow = document.querySelector('.left-arrow');
const rightArrow = document.querySelector('.right-arrow');
const photos = ['gg.png','1.png','2.png']; // the photos here
let currentPhotoIndex = 0;
const updateSliderPhoto = () => {
document.querySelector('.slider-photo').src = photos[currentPhotoIndex];
};
leftArrow.addEventListener('click', () => {
currentPhotoIndex = (currentPhotoIndex === 0) ? photos.length - 1 : currentPhotoIndex - 1;
updateSliderPhoto();
});
rightArrow.addEventListener('click', () => {
currentPhotoIndex = (currentPhotoIndex === photos.length - 1) ? 0 : currentPhotoIndex + 1;
updateSliderPhoto();
});
// Automatically change the image every 10 seconds
setInterval(() => {
currentPhotoIndex = (currentPhotoIndex === photos.length - 1) ? 0 : currentPhotoIndex + 1;
updateSliderPhoto();
}, 10000); // 10000ms = 10 seconds
$("#joinbtn").click(function(){
$.post("https://analytics.colonialcoders.com/click/joinbtn");
window.open('https://docs.google.com/forms/d/e/1FAIpQLSdJ2Ic614-XYOYxw9EyDpsMo8uM6AypKhAs4d8Iw0WGppwhUQ/viewform', '_blank');
});