1function getRandomInt(min, max) { 2 min = Math.ceil(min); 3 max = Math.floor(max); 4 return Math.floor(Math.random() * (max - min) + min); // The maximum is exclusive and the minimum is inclusive 5} 6 7document.addEventListener('DOMContentLoaded', function () { 8 const swipers = document.getElementsByClassName('swiper') 9 // console.log(swipers) 10 11 for (let i = 0; i < swipers.length; i++) { 12 const element = swipers[i]; 13 new Swiper(`#${element.id}`, { 14 // Optional parameters 15 direction: 'vertical', 16 loop: true, 17 initialSlide: i * 2, 18 spaceBetween: 10, 19 slidesPerView: 1, 20 21 autoplay: { 22 delay: getRandomInt(4000, 10000), 23 disableOnInteraction: false, 24 }, 25 26 // If we need pagination 27 pagination: { 28 el: ".swiper-pagination", 29 dynamicBullets: true, 30 }, 31 32 // Navigation arrows 33 navigation: { 34 nextEl: '.swiper-button-next', 35 prevEl: '.swiper-button-prev', 36 }, 37 38 // And if we need scrollbar 39 scrollbar: { 40 el: '.swiper-scrollbar', 41 }, 42 }); 43 } 44})
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.