1( function( $ ) { 2 3 var pxl_swiper_handler = function( $scope, $ ) { 4 5 var breakpoints = elementorFrontend.config.breakpoints, 6 carousel = $scope.find(".pxl-swiper-container"); 7 if(carousel.length == 0){ 8 return false; 9 } 10 11 /* Arrow Custom */ 12 $('.pxl-swiper-arrow-custom').parents('.pxl-swiper-sliders').addClass('pxl--hide-arrow'); 13 $('.pxl-navigation-carousel').parents('.elementor-section').addClass('pxl--hide-arrow'); 14 setTimeout(function() { 15 $('.pxl-swiper-arrow-custom.pxl-swiper-arrow-next').on('click', function () { 16 $(this).parents('.pxl-swiper-sliders').find('.pxl-swiper-arrow-main.pxl-swiper-arrow-next').trigger('click'); 17 }); 18 $('.pxl-swiper-arrow-custom.pxl-swiper-arrow-prev').on('click', function () { 19 $(this).parents('.pxl-swiper-sliders').find('.pxl-swiper-arrow-main.pxl-swiper-arrow-prev').trigger('click'); 20 }); 21 }, 300); 22 23 setTimeout(function() { 24 $('.pxl-navigation-carousel .pxl-navigation-arrow-prev').on('click', function () { 25 $(this).parents('.elementor-section').find('.pxl-swiper-arrow.pxl-swiper-arrow-prev').trigger('click'); 26 }); 27 $('.pxl-navigation-carousel .pxl-navigation-arrow-next').on('click', function () { 28 $(this).parents('.elementor-section').find('.pxl-swiper-arrow.pxl-swiper-arrow-next').trigger('click'); 29 }); 30 }, 300); 31 32 /* Main Slider */ 33 var data = carousel.data(), 34 settings = data.settings, 35 carousel_settings = { 36 direction: settings['slide_direction'], 37 effect: settings['slide_mode'], 38 wrapperClass : 'pxl-swiper-wrapper', 39 slideClass: 'pxl-swiper-slide', 40 slidesPerView: settings['slides_to_show'], 41 slidesPerGroup: settings['slides_to_scroll'], 42 slidesPerColumn: settings['slide_percolumn'], 43 spaceBetween: 0, 44 navigation: {
45 nextEl: $scope.find(".pxl-swiper-arrow-next"), 46 prevEl: $scope.find(".pxl-swiper-arrow-prev"), 47 }, 48 pagination : { 49 el: $scope.find(".pxl-swiper-dots"), 50 clickable : true, 51 modifierClass: 'pxl-swiper-pagination-', 52 bulletClass : 'pxl-swiper-pagination-bullet', 53 renderCustom: function (swiper, element, current, total) { 54 return current + ' of ' + total; 55 }, 56 type: settings['pagination_type'], 57 }, 58 speed: settings['speed'], 59 watchSlidesProgress: true, 60 watchSlidesVisibility: true, 61 breakpoints: { 62 0 : { 63 slidesPerView: settings['slides_to_show_xs'], 64 slidesPerGroup: settings['slides_to_scroll'], 65 }, 66 576 : { 67 slidesPerView: settings['slides_to_show_sm'], 68 slidesPerGroup: settings['slides_to_scroll'], 69 }, 70 768 : { 71 slidesPerView: settings['slides_to_show_md'], 72 slidesPerGroup: settings['slides_to_scroll'], 73 }, 74 1025 : { 75 slidesPerView: settings['slides_to_show_lg'], 76 slidesPerGroup: settings['slides_to_scroll'], 77 }, 78 1200 : { 79 slidesPerView: settings['slides_to_show'], 80 slidesPerGroup: settings['slides_to_scroll'], 81 }, 82 1600 : { 83 slidesPerView: settings['slides_to_show_xxl'], 84 slidesPerGroup: settings['slides_to_scroll'], 85 } 86 }, 87 on: { 88 progress: function (swiper) { 89 var el_id = $scope.find('.pxl-slider-progressbar'); 90 var el_width = 1; 91 var el_autoplayTime = settings['delay'] / 100; 92 var el_id_slider = setInterval(f_frame, el_autoplayTime); 93 function f_frame() { 94 if (el_width >= 100) { 95 clearInterval(el_id_slider); 96 } else { 97 el_width++; 98 el_id.css('width', el_width + '%'); 99 } 100 } 101 }, 102 103 slideChangeTransitionStart : function (swiper){ 104 var activeIndex = this.activeIndex; 105 var current = this.slides.eq(activeIndex); 106 107 $scope.find('.pxl-element-slider .pxl-swiper-slide .wow').each(function(){ 108 $(this).removeClass('animated').addClass('pxl-invisible'); 109 }); 110 current.find('.pxl-element-slider .wow').each(function(){ 111 $(this).removeClass('pxl-invisible').addClass('animated'); 112 }); 113 114 }, 115 116 slideChange: function (swiper) { 117 118 var activeIndex = this.activeIndex; 119 var current = this.slides.eq(activeIndex); 120 121 $scope.find('.pxl-element-slider .pxl-swiper-slide .wow').each(function(){ 122 $(this).removeClass('animated').addClass('pxl-invisible'); 123 }); 124 current.find('.pxl-element-slider .wow').each(function(){ 125 $(this).removeClass('pxl-invisible').addClass('animated'); 126 }); 127 128 }, 129 130 sliderMove: function (swiper) { 131 132 var activeIndex = this.activeIndex; 133 var current = this.slides.eq(activeIndex); 134 135 $scope.find('.pxl-element-slider .pxl-swi
135per-slide .wow').each(function(){ 136 $(this).removeClass('animated').addClass('pxl-invisible'); 137 }); 138 current.find('.pxl-element-slider .wow').each(function(){ 139 $(this).removeClass('pxl-invisible').addClass('animated'); 140 }); 141 142 }, 143 144 } 145 }; 146 // custom fraction 147 // if( settings['pagination_type'] === 'bullets' && settings['pagination_number'] === 'true' ){ 148 // carousel_settings['on'] = { 149 // slideChange: function(){ 150 // var currentSlide = this.realIndex + 1; 151 // document.querySelector('.pxl-swiper-current-slide').innerHTML = currentSlide; 152 // }, 153 // paginationRender: function(){ 154 // var totalSlides = document.getElementsByClassName('pxl-swiper-pagination-bullet').length; 155 // document.querySelector('.pxl-swiper-total-slides').innerHTML = totalSlides; 156 // } 157 // }; 158 // } 159 160 // center 161 if(settings['center'] === 'true'){ 162 carousel_settings['centeredSlides'] = true; 163 } 164 // effect 165 if(settings['slide_mode'] === 'fade'){ 166 carousel_settings['fadeEffect'] = { 167 crossFade: true 168 }; 169 } 170 // loop 171 if(settings['loop'] === 'true'){ 172 carousel_settings['loop'] = true; 173 } 174 // auto play 175 if(settings['autoplay'] === 'true'){ 176 carousel_settings['autoplay'] = { 177 delay : settings['delay'], 178 disableOnInteraction : settings['pause_on_interaction'] 179 }; 180 } else { 181 carousel_settings['autoplay'] = false; 182 } 183 184 carousel.each(function(index, element) { 185
186 var carousel_thumb = $scope.find(".pxl-swiper-thumbs"); 187 var center = $scope.find(".pxl-swiper-thumbs").data("center"); 188 var loop = $scope.find(".pxl-swiper-thumbs").data("loop"); 189 var thumbxs = $scope.find(".pxl-swiper-thumbs").data("thumbxs"); 190 var thumbsm = $scope.find(".pxl-swiper-thumbs").data("thumbsm"); 191 var thumbmd = $scope.find(".pxl-swiper-thumbs").data("thumbmd"); 192 var thumblg = $scope.find(".pxl-swiper-thumbs").data("thumblg"); 193 if (carousel_thumb.length > 0) { 194 var galleryThumbs = new Swiper(carousel_thumb, { 195 spaceBetween: 0, 196 slidesPerView: 3, 197 freeMode: true, 198 watchSlidesProgress: true, 199 centeredSlides: center, 200 loop: loop, 201 breakpoints: { 202 0 : { 203 slidesPerView: typeof thumbxs !== 'undefined' ? thumbxs : 1, 204 }, 205 576 : { 206 slidesPerView: typeof thumbsm !== 'undefined' ? thumbsm : 2, 207 }, 208 768 : { 209 slidesPerView: typeof thumbmd !== 'undefined' ? thumbmd : 3, 210 }, 211 1025 : { 212 slidesPerView: typeof thumblg !== 'undefined' ? thumblg : 3, 213 }, 214 } 215 }); 216 carousel_settings['thumbs'] = { swiper: galleryThumbs }; 217 } 218 219 var swiper = new Swiper(carousel, carousel_settings); 220 221 if(settings['autoplay'] === 'true' && settings['pause_on_hover'] === 'true'){ 222 $(this).on({ 223 mouseenter: function mouseenter() { 224 this.swiper.autoplay.stop(); 225 }, 226 mouseleave: function mouseleave() { 227 this.swiper.autoplay.start(); 228 } 229 }); 230 } 231 232 $scope.find(".swiper-filter-wrap .filter-item").on("click", function(){ 233 var target = $(this).attr('data-filter-target'); 234 var parent = $(this).closest('.pxl-swiper-sliders'); 235 $(this).siblings().removeClass("active"); 236 $(this).addClass("active"); 237 238 if(target == "all"){ 239 parent.find("[data-filter]").removeClass("non-swiper-slide").addClass("swiper-slide-filter"); 240 swiper.destroy(); 241 swiper = new Swiper(carousel, carousel_settings); 242 } else { 243 244 parent.find(".swiper-slide-filter").not("[data-filter^='"+target+"'], [data-filter*=' "+target+"']").addClass("non-swiper-slide").removeClass("swiper-slide-filter"); 245 parent.find("[data-filter^='"+target+"'], [data-filter*=' "+target+"']").removeClass("non-swiper-slide").addClass("swiper-slide-filter"); 246 swiper.destroy(); 247 swiper = new Swiper(carousel, carousel_settings); 248 } 249 }); 250 251 $('.swiper-filter-wrap').parents('.pxl-swiper-sliders').addClass('swiper-filter-active'); 252 253 }); 254 255 }; 256 257 // Make sure you run this code under Elementor. 258 $( window ).on( 'elementor/frontend/init', function() { 259 // Swipers 260 elementorFrontend.hooks.addAction( 'frontend/element_ready/pxl_post_carousel.default', pxl_swiper_handler ); 261 elementorFrontend.hooks.addAction( 'frontend/element_ready/pxl_history_carousel.default', pxl_swiper_handler ); 262 elementorFrontend.hooks.addAction( 'frontend/element_ready/pxl_client_carousel.default', pxl_swiper_handler ); 263 elementorFrontend.hooks.addAction( 'frontend/element_ready/pxl_slider.default', pxl_swiper_handler ); 264 elementorFrontend.hooks.addAction( 'frontend/element_ready/pxl_testimonial_carousel.default', pxl_swiper_handler ); 265 elementorFrontend.hooks.addAction( 'frontend/element_ready/pxl_team_carousel.default', pxl_swiper_handler ); 266 elementorFrontend.hooks.addAction( 'frontend/element_ready/pxl_gallery_carousel.default', pxl_swiper_handler ); 267 elementorFrontend.hooks.addAction( 'frontend/element_ready/pxl_partner_carousel.default', pxl_swiper_handler ); 268 } ); 269} )( 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.