1(function ($) { 2 $(function () { 3 var $swiperElement = $('.swiper-container-authentification:not(.swiper-is-init)'); 4 5 if (!$swiperElement.length) { 6 return; 7 } 8 9 // NOTE: Avoid multiples instances 10 $swiperElement.addClass('swiper-is-init'); 11 12 var swiperLogin = new Swiper($swiperElement, { 13 effect: 'fade', 14 wrapperClass: 'swiper-wrapper-authentification', 15 fadeEffect: { 16 crossFade: true 17 }, 18 autoplay: { 19 delay: 5000 20 } 21 }); 22 23 // All the buttons in the slider 24 var $buttonContainers = $swiperElement.find('.swiper-btn'); 25 26 if ($buttonContainers.length) { 27 // Set active slide an active class 28 $buttonContainers.eq(swiperLogin.activeIndex).addClass('active'); 29 30 // Adds slide change on slides' buttons hover 31 $buttonContainers.each(function(index) { 32 $(this).on('mouseenter', function() { 33 swiperLogin.slideTo(index); 34 $buttonContainers.eq(swiperLogin.previousIndex).removeClass('active'); 35 36 $(this).addClass('active'); 37 }).on('mouseleave', function() { 38 // Reactivate autoplay on leave 39 swiperLogin.autoplay.start(); 40 }); 41 }); 42 } 43 44 // Change active class on slides 45 swiperLogin.on('slideChange', function () { 46 $buttonContainers = $swiperElement.find('.swiper-btn'); 47 48 $buttonContainers.eq(swiperLogin.previousIndex).removeClass('active'); 49 $buttonContainers.eq(swiperLogin.activeIndex).addClass('active'); 50 }); 51 52 $(window).on('toolbar_has_changed', function() { 53 if ($swiperElement.length) { 54 swiperLogin.update(); 55 } 56 }); 57 }); 58})(window.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.