-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathscript.js
26 lines (22 loc) · 967 Bytes
/
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
function myFunction() {
var x = document.getElementById("myTopnav");
if (x.className === "topnav") {
x.className += " responsive";
} else {
x.className = "topnav";
}
}
let currentFeedbackIndex = 0; // Initialize with the first feedback
function showFeedback(direction) {
const feedbackElements = document.querySelectorAll('.client-feedback');
// Hide the current feedback
feedbackElements[currentFeedbackIndex].style.display = 'none';
// Calculate the new index based on the direction
if (direction === 'next') {
currentFeedbackIndex = (currentFeedbackIndex + 1) % feedbackElements.length;
} else if (direction === 'back') {
currentFeedbackIndex = (currentFeedbackIndex - 1 + feedbackElements.length) % feedbackElements.length;
}
// Show the new feedback
feedbackElements[currentFeedbackIndex].style.display = 'block';
}