Hi,
I'm looking for some help with code which can auto-scroll my 2 testimonial sliders on a single webpage. I found the below code but it only seems to auto-scroll the 1st slider, I would like both please
<!-- Auto Scroll Layout Sections from Will-Myers.com -->
<script>
(function(){
let playInBackend = true,
timing = 3,
direction = 1; //1 = forwards, 0 = backwards
/* Do not Adjust below this line */
function AutoScrollLayout(e) {
e = e ? document.querySelector(e) : document.querySelector(".user-items-list-section");
let t, n, o, i, c, r = false,
s = e.querySelectorAll('button[class*="__arrow-button"]');
function d() {
t = setInterval(u, n);
}
function u() {
o = document.querySelector("body.sqs-edit-mode-active");
i = document.querySelector(".sqs-modal-lightbox-open");
if (!r && !o && !i && c && s[direction]) {
s[direction].click();
}
}
n = 1000 * timing;
if (document.addEventListener("visibilitychange", function() {
r = !!document.hidden;
}), ["mousedown", "touchstart"].forEach(t => {
e.addEventListener(t, function() {
r = true;
});
}), ["mouseup", "touchend"].forEach(n => {
e.addEventListener(n, function() {
r = false;
clearInterval(t);
d();
});
}), window.IntersectionObserver) {
new IntersectionObserver((e, t) => {
e.forEach(e => {
c = !!e.isIntersecting;
});
}, {
rootMargin: "-75px 0px -75px 0px"
}).observe(e);
}
if (s[direction]) d();
}
window.addEventListener("load", function() {
let sections = document.querySelectorAll(".user-items-list-section");
sections.forEach(section => {
if (window.top == window.self || (window.top !== window.self && playInBackend)) {
new AutoScrollLayout(section);
}
});
});
}());
</script>