1jQuery(document).ready(function($) { 2 $('.slideshow-container').each(function() { 3 let container = $(this); 4 let track = container.find('.slideshow-track'); 5 let items = container.find('.slideshow-item'); 6 let count = parseInt(container.data('count')) || 3; 7 let current = 0; 8 let paused = false; 9 10 function updateSlide() { 11 let offset = -current * (100 / count); 12 track.css('transform', 'translateX(' + offset + '%)'); 13 } 14 15 function nextSlide() { 16 if (!paused) { 17 current++; 18 if (current > items.length - count) { 19 current = 0; 20 } 21 updateSlide(); 22 } 23 } 24 25 let interval = setInterval(nextSlide, 5000); 26 27 container.on('mouseenter', function() { paused = true; }); 28 container.on('mouseleave', function() { paused = false; }); 29 30 container.find('.slideshow-prev').on('click', function() { 31 current--; 32 if (current < 0) { 33 current = items.length - count; 34 } 35 updateSlide(); 36 }); 37 38 container.find('.slideshow-next').on('click', function() { 39 current++; 40 if (current > items.length - count) { 41 current = 0; 42 } 43 updateSlide(); 44 }); 45 }); 46});
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.