1document.addEventListener('DOMContentLoaded', function () { 2 3 const container = document.querySelector('.x-recent-posts.horizontal'); 4 if (!container) return; 5 6 // Add Swiper classes dynamically 7 container.classList.add('swiper'); 8 9 const links = container.querySelectorAll('a'); 10 links.forEach(link => link.classList.add('swiper-slide')); 11 12 const wrapper = document.createElement('div'); 13 wrapper.className = 'swiper-wrapper'; 14 15 links.forEach(link => wrapper.appendChild(link)); 16 container.appendChild(wrapper); 17 18 // Navigation 19 container.insertAdjacentHTML('beforeend', ` 20 <div class="swiper-button-prev"></div> 21 <div class="swiper-button-next"></div> 22 `); 23 24 // Init Swiper 25 new Swiper('.x-recent-posts.horizontal.swiper', { 26 slidesPerView: 1, 27 spaceBetween: 20, 28 loop: true, // <-- This enables looping 29 navigation: { 30 nextEl: '.swiper-button-next', 31 prevEl: '.swiper-button-prev', 32 }, 33 breakpoints: { 34 768: { 35 slidesPerView: 2, 36 }, 37 1024: { 38 slidesPerView: 4, 39 } 40 } 41 }); 42 43 44 //recent-sports-videos/////////////// 45 ///////////////////////////////////// 46 47 const container2 = document.querySelector('.recent-sports-videos'); 48 if (!container2) return; 49 50 // Add Swiper classes dynamically 51 container2.classList.add('swiper'); 52 53 const links2 = container2.querySelectorAll('.sports-video-item'); 54 links2.forEach(link => link.classList.add('swiper-slide')); 55 56 const wrapper2 = document.createElement('div'); 57 wrapper2.className = 'swiper-wrapper'; 58 59 links2.forEach(link => wrapper2.appendChild(link)); 60 container2.appendChild(wrapper2); 61 62 // Navigation 63 container2.insertAdjacentHTML('beforeend', ` 64 <div class="swiper-button-prev"></div> 65 <div class="swiper-button-next"></div> 66 `); 67 68 // Init Swiper 69 new Swiper('.recent-sports-videos.swiper', { 70 slidesPerView: 1, 71 spaceBetween: 20, 72 loop: true, // <-- This enables looping 73 navigation: { 74 nextEl: '.swiper-button-next', 75 prevEl: '.swiper-button-prev', 76 }, 77 breakpoints: { 78 768: { 79 slidesPerView: 2, 80 }, 81 1024: { 82 slidesPerView: 4, 83 } 84 } 85 }); 86 87});
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.