document.querySelectorAll('.wd-carousel').forEach(container => { function checkScroll() { const maxScroll = container.scrollWidth - container.clientWidth; if (container.scrollLeft >= maxScroll - 2) { container.classList.add('at-end'); } else { container.classList.remove('at-end'); } } container.addEventListener('scroll', checkScroll); window.addEventListener('resize', checkScroll); checkScroll(); });
No account yet?
Create an Account