1// Carousel js 2(function ($) { 3 4 var dtAnyCarouselsWidgetHandler = function($scope, $){ 5 6 var carouselElement = $scope.find('.dt-sc-any-carousel-wrapper.carousel_items').each(function(){ 7 var carouselSettings = $(this).data('settings'), 8 slides_to_show = (carouselSettings['slides_to_show'] !== undefined) ? parseInt(carouselSettings['slides_to_show']) : 1, 9 slides_to_scroll = (carouselSettings['slides_to_scroll'] !== undefined) ? parseInt(carouselSettings['slides_to_scroll']) : 1, 10 11 effect = (carouselSettings['effect'] !== undefined) ? (carouselSettings['effect']) : 'slide', 12 arrows = (carouselSettings['arrows'] !== undefined) ? (carouselSettings['arrows'] == 'yes') : false, 13 direction = (carouselSettings['direction'] !== undefined) ? (carouselSettings['direction']) : 'horizontal', 14 pagination = (carouselSettings['pagination'] !== undefined) ? (carouselSettings['pagination']) : '', 15 speed = (carouselSettings['speed'] !== undefined) ? parseInt(carouselSettings['speed']) : 400, 16 auto = (carouselSettings['autoplay'] !== undefined) ? (carouselSettings['autoplay'] == 'yes') : false, 17 autoplay_speed = (carouselSettings['autoplay_speed'] !== undefined) ? parseInt(carouselSettings['autoplay_speed']) : 2500, 18 loop = (carouselSettings['loop'] !== undefined) ? (carouselSettings['loop'] == 'yes') : false, 19 pause_on_interaction = (carouselSettings['pause_on_interaction'] !== undefined) ? (carouselSettings['pause_on_interaction'] == 'yes') : false, 20 21 slides_to_show_tablet = (carouselSettings['slides_to_show_tablet'] !== undefined) ? parseInt(carouselSettings['slides_to_show_tablet']) : 1, 22 slides_to_scroll_tablet = (carouselSettings['slides_to_scroll_tablet'] !== undefined) ? parseInt(carouselSettings['slides_to_scroll_tablet']) : 1, 23 24 slides_to_show_mobile = (carouselSettings['slides_to_show_mobile'] !== undefined) ? parseInt(carouselSettings['slides_to_show_mobile']) : 1, 25 slides_to_scroll_mobile = (carouselSettings['slides_to_scroll_mobile'] !== undefined) ? parseInt(carouselSettings['slides_to_scroll_mobile']) : 1; 26 27 var $swiperItem = $(this); 28 29 var swiperOptions = { 30 initialSlide: 0, 31 simulateTouch: true, 32 roundLengths: true, 33 keyboardControl: true, 34 paginationClickable: true, 35 autoHeight: false, 36 grabCursor: true, 37 38 slidesPerView: slides_to_show, 39 slidesPerGroup: slides_to_scroll, 40 loop:loop, 41 42 effect: effect, 43 direction: direction, 44 speed: speed, 45 46 breakpoints: { 47 1024: { 48 slidesPerView: slides_to_show_tablet, 49 slidesPerGroup: slides_to_scroll_tablet, 50 }, 51 768: { 52 slidesPerView: slides_to_show_tablet, 53 slidesPerGroup: slides_to_scroll_tablet, 54 }, 55 640: { 56 slidesPerView: slides_to_show_mobile, 57 slidesPerGroup: slides_to_scroll_mobile, 58 }, 59 320: { 60 slidesPerView: slides_to_show_mobile, 61 slidesPerGroup: slides_to_scroll_mobile, 62 } 63 } 64 } 65 66 if (arrows) { 67 swiperOptions.navigation = { 68 prevEl: $(this).find('.swiper-button-prev'), 69 nextEl: $(this).find('.swiper-button-next') 70 }; 71 } 72 73 if (pagination != '') { 74 if( pagination == 'scrollbar' ) { 75 swiperOptions.scrollbar = { 76 el: $(this).find('.swiper-scrollbar'), 77 type: pagination, 78 hide: true 79 }; 80 } else { 81 swiperOptions.pagination = { 82 el: $(this).find('.swiper-pagination'), 83 type: pagination, 84 clickable: true 85 }; 86 } 87 } 88 89 if (auto) { 90 swiperOptions.autoplay = { 91 delay: autoplay_speed, 92 disableOnInteraction: pause_on_interaction 93 }; 94 } 95 96 var swiper = new Swiper($swiperItem, swiperOptions); 97 98/* swiper.on('slideChange', function() { 99 100 var sIndex = parseInt(swiper.activeIndex, 10); 101 var sHeight = $swiperItem.find('.swiper-slide:eq('+sIndex+')').height(); 102 $swiperItem.find('.swiper-slide:eq('+sIndex+')').css('height', sHeight); 103 $swiperItem.find('.swiper-wrapper').css('height', sHeight); 104 $swiperItem.css('height', sHeight+' !important'); 105 106 }); 107 */ 108 109 }); 110 }; 111 112 //Elementor JS Hooks 113 $(window).on('elementor/frontend/init', function () { 114 115 elementorFrontend.hooks.addAction('frontend/element_ready/dt-anycarousel.default', dtAnyCarouselsWidgetHandler); 116 117 }); 118 119})(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.