1document.addEventListener('DOMContentLoaded', function() { 2 const swiper2 = new Swiper('.myFullSwiper', { 3 slidesPerView: 1, 4 slidesPerGroup: 1, 5 spaceBetween: 20, 6 centeredSlides: false, 7 loop: false, 8 watchOverflow: true, 9 navigation: { 10 nextEl: '.slider_prepods_next', 11 prevEl: '.slider_prepods_prev', 12 enabled: false 13 }, 14 pagination: { 15 el: '.swiper-pagination-2', 16 clickable: true, 17 enabled: true 18 }, 19 breakpoints: { 20 380: { 21 slidesPerView: 1, 22 slidesPerGroup: 1 23 }, 24 576: { 25 slidesPerView: 2.7, 26 slidesPerGroup: 1, 27 pagination: { enabled: false }, 28 navigation: { enabled: true } 29 }, 30 768: { 31 slidesPerView: 3.7, 32 slidesPerGroup: 1, 33 pagination: { enabled: false }, 34 navigation: { enabled: true } 35 }, 36 1200: { 37 slidesPerView: 4.7, 38 slidesPerGroup: 1, 39 pagination: { enabled: false }, 40 navigation: { enabled: true } 41 }, 42 }, 43 on: { 44 beforeInit: function() { 45 if (window.innerWidth >= 768) { 46 updateOffset(this); 47 } 48 }, 49 resize: function() { 50 if (window.innerWidth >= 768) { 51 updateOffset(this); 52 } else { 53 // Ðа мобилÑнÑÑ Ð¿ÑинÑдиÑелÑно вÑклÑÑаем ÑмеÑÐµÐ½Ð¸Ñ 54 this.params.slidesOffsetBefore = 0; 55 this.params.slidesOffsetAfter = 0; 56 } 57 } 58 } 59 }); 60 61 function updateOffset(swiper) { 62 const contentContainer = document.querySelector('main'); 63 if (!contentContainer) return; 64 65 const offset = contentContainer.getBoundingClientRect().left; 66 67 // 100ms гаÑанÑиÑÑÑÑ, ÑÑо Safari и Chrome ÑÑпеÑÑ Ð¾ÑÑендеÑиÑÑ 100vw и 50vw 68 setTimeout(() => { 69 if (swiper.params.slidesOffsetBefore !== offset) { 70 swiper.params.slidesOffsetBefore = offset; 71 72 // ÐозвÑаÑаем оÑигиналÑнÑй меÑод полного пеÑеÑÑеÑа, ÑÑÐ¾Ð±Ñ ÑÐ»Ð°Ð¹Ð´Ñ ÑÑ Ð¾Ð´Ð¸Ð»Ð¸ впÑаво 73 swiper.update(); 74 75 // ÐÑинÑдиÑелÑно жеÑÑко ÑикÑиÑÑем ÑÐ»Ð°Ð¹Ð´ÐµÑ Ð½Ð° пеÑвом ÑлеменÑе пÑи ÑÑаÑÑе 76 swiper.slideTo(0, 0); 77 } 78 }, 100); 79 } 80 81 82 let resizeTimeout; 83 window.addEventListener('resize', () => { 84 clearTimeout(resizeTimeout); 85 resizeTimeout = setTimeout(() => { 86 if (swiper2 && window.innerWidth >= 768) { 87 updateOffset(swiper2); 88 } 89 }, 50); 90 }); 91});
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.