1(function($){ 2 3 var sliderInit = function(blockElement){ 4 5 //on récupère les parmètres définit dans le block slider 6 var sldrId = $(blockElement).find('.swiper').data('swiper'); 7 8 if ( $(`.entetepage__slider .swiper${sldrId} .swiper-slide`).length > 1 ) { 9 //paramètres par défaut du slider swiper 10 var args = { 11 loop:true, 12 direction: 'horizontal', 13 preloadImages: false, 14 lazy: true, 15 slidesPerView: 1, 16 autoplay: { 17 delay: 5000, 18 }, 19 } 20 21 //on initialise le slider swiper 22 const swiperSlider = new Swiper('.swiper'+sldrId, args); 23 24 }else { 25 $(`.entetepage__slider .swiper${sldrId} .swiper-wrapper`).addClass("swiper-noactive"); 26 } 27 28 } 29 30 // Initialize each block on page load (front end). 31 $(document).ready(function(){ 32 $('.section-entetepage').each(function(){ 33 sliderInit(this); 34 }); 35 }); 36 37 // Initialize dynamic block preview (editor). 38 if( window.acf ) { 39 window.acf.addAction('render_block_preview/type=slider', sliderInit); 40 } 41 42})(jQuery);
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.