var maAdvancedCarousel = function($scope, $) { var maAdvancedCarousel = $scope.find(".tm-slider").eq(0); maAdvancedCarousel.each(function(index, el) { var mobiles = jQuery(this).data('mobiles'); var tabs = jQuery(this).data('tabs'); jQuery(this).slick({ dots: true, infinite: true, slidesToShow: 1, autoplay: true, autoplaySpeed: 2000, responsive: [ { breakpoint: 1024, settings: { slidesToShow: tabs, slidesToScroll: 1 } }, { breakpoint: 480, settings: { slidesToShow: mobiles, slidesToScroll: 1 } } ] }); }); jQuery(document).ready(function() { setTimeout(function() { jQuery('.tm-slider.slick-slider .slick-next, .post-slider.slick-slider .slick-next').addClass('fas fa-chevron-right'); jQuery('.tm-slider.slick-slider .slick-prev, .post-slider.slick-slider .slick-prev').addClass('fas fa-chevron-left'); }, 300); }); } // Make sure you run this code under Elementor.. jQuery(window).on('elementor/frontend/init', function () { elementorFrontend.hooks.addAction( 'frontend/element_ready/advanced-carousel.default', maAdvancedCarousel ); });