1const buttonsSliderJ = document.querySelectorAll('[data-carousel-button]') 2 3buttonsSliderJ.forEach(button => { 4 button.addEventListener('click', () => { 5 const offset = button.dataset.carouselButton === "next" ? 1: -1 6 const slides = button.closest('[data-carousel]').querySelector('[data-slides]') 7 8 const activeSlide = slides.querySelector('[data-active]') 9 let newIndex = [...slides.children].indexOf(activeSlide) + offset 10 if(newIndex < 0) newIndex = slides.children.length - 1 11 if(newIndex >= slides.children.length) newIndex = 0 12 13 slides.children[newIndex].dataset.active = true 14 delete activeSlide.dataset.active 15 }) 16})
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.