I am sorry if the title has caused any confusion, but it is exactly as it states. I want to create a testimonial card using a table as the base. I have almost completed it, but I am struggling with the final touches. For instance, I want to implement a functionality where clicking a pointer will swipe the card to the next one. I believe utilizing an array of children and moving based on the index could work, but I am having trouble getting the testimony card to move.
While researching, I came across a similar topic that may provide some guidance: Scroll smoothly by 100px horizontally
However, I am still unsure of how to go about implementing this feature in my code.
This is the code snippet I currently have:
var slideIndex = 1;
showSlides(slideIndex);
// Thumbnail image controls
function currentTestimony(n) {
showSlides(slideIndex = n);
}
function showSlides(n) {
var i;
var slides = document.getElementsByClassName("slider-item");
var pointers = document.getElementsByClassName("pointer");
if (n > slides.length) {
slideIndex = 1
}
if (n < 1) {
slideIndex = slides.length
}
for (i = 0; i < pointers.length; i++) {
pointers[i].className = pointers[i].className.replace(" active", "");
}
pointers[slideIndex-1].className += " active";
}
I feel like I am getting closer to the solution, but I am still stuck. Can anyone provide assistance in solving this issue?