1$(document).ready(function () { 2 const productCarouselItems4Init = function () { 3 $('.products-carousel-4').slick({ 4 infinite: false, 5 arrows: true, 6 dots: false, 7 rows: 0, 8 slidesToShow: 4, 9 slidesToScroll: 1, 10 accessibility: false, 11 autoplaySpeed: 3000, 12 centerMode: false, 13 swipeToSlide: true, 14 swipe: true, 15 responsive: [ 16 { 17 breakpoint: 1200, 18 settings: { 19 slidesToShow: 3 20 } 21 }, 22 { 23 breakpoint: 1011, 24 settings: { 25 slidesToShow: 2 26 } 27 }, 28 { 29 breakpoint: 768, 30 settings: { 31 infinite: false, 32 slidesToShow: 1, 33 centerMode: false, 34 arrows: true, 35 swipe: true, 36 dots: false 37 } 38 } 39 ] 40 }).on('setPosition', function () { 41 $(this).find('.slick-slide').height('auto'); 42 let slickTrack = $(this).find('.slick-track'); 43 let slickTrackHeight = $(slickTrack).height(); 44 $(this).find('.slick-slide').css('height', slickTrackHeight + 'px'); 45 }); 46 }; 47 48 if ($('.products-carousel-4').length > 0) { 49 productCarouselItems4Init(); 50 } 51 52 function isMobileGallery() { 53 return window.innerWidth < 768; 54 } 55 56 function setGalleryImage($container, index, newSrc) { 57 $container.find('.js-gallery-main-picture img').attr('src', newSrc); 58 59 const $lines = $container.find('.js-gallery-statusbar .statusbar-line'); 60 $lines.removeClass('active'); 61 $lines.eq(index).addClass('active'); 62 } 63 64 function resetGalleryImage($container) { 65 const $firstZone = $container.find('.js-gallery-zone').first(); 66 if (!$firstZone.length) return; 67 68 setGalleryImage($container, 0, $firstZone.data('src')); 69 } 70 71 $(document).on('mouseenter', '.js-gallery-zone', function () { 72 if (isMobileGallery()) return; 73 74 const $zone = $(this); 75 const $container = $zone.closest('.js-hover-gallery'); 76 77 setGalleryImage($container, $zone.data('index'), $zone.data('src')); 78 }); 79 80 $(document).on('mouseleave', '.js-hover-gallery', function () { 81 if (isMobileGallery()) return; 82 resetGalleryImage($(this)); 83 }); 84 85 $(document).on('touchstart click', '.js-gallery-zone', function (e) { 86 if (!isMobileGallery()) return; 87 88 e.preventDefault(); 89 e.stopPropagation(); 90 91 const $zone = $(this); 92 const $container = $zone.closest('.js-hover-gallery'); 93 94 setGalleryImage($container, $zone.data('index'), $zone.data('src')); 95 96 return false; 97 }); 98});
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.