| 1 |
(function(){ |
| 2 |
//#region dev/js/addons/free/ma-tabs.js |
| 3 |
/** |
| 4 |
* Start tabs widget script |
| 5 |
*/ |
| 6 |
(function($, elementor) { |
| 7 |
"use strict"; |
| 8 |
var JLTMA_Tabs = function($scope, $) { |
| 9 |
try { |
| 10 |
var $tabsWrapper = $scope.find("[data-tabs]"), $tabEffect = $tabsWrapper.data("tab-effect"); |
| 11 |
$tabsWrapper.each(function() { |
| 12 |
var tab = $(this); |
| 13 |
var isContentActive = false; |
| 14 |
tab.find("[data-tab]").each(function() { |
| 15 |
if ($(this).hasClass("active")) {} |
| 16 |
}); |
| 17 |
tab.find(".jltma--advance-tab-content").each(function() { |
| 18 |
if ($(this).hasClass("active")) isContentActive = true; |
| 19 |
}); |
| 20 |
if (!isContentActive) tab.find(".jltma--advance-tab-content").eq(0).addClass("active"); |
| 21 |
if ($tabEffect == "hover") tab.find("[data-tab]").hover(function() { |
| 22 |
var $data_tab_id = $(this).data("tab-id"); |
| 23 |
$(this).siblings().removeClass("active"); |
| 24 |
$(this).addClass("active"); |
| 25 |
$(this).closest("[data-tabs]").find(".jltma--advance-tab-content").removeClass("active"); |
| 26 |
$("#" + $data_tab_id).addClass("active"); |
| 27 |
}); |
| 28 |
else tab.find("[data-tab]").click(function() { |
| 29 |
var $data_tab_id = $(this).data("tab-id"); |
| 30 |
$(this).siblings().removeClass("active"); |
| 31 |
$(this).addClass("active"); |
| 32 |
$(this).closest("[data-tabs]").find(".jltma--advance-tab-content").removeClass("active"); |
| 33 |
$("#" + $data_tab_id).addClass("active"); |
| 34 |
}); |
| 35 |
}); |
| 36 |
} catch (e) {} |
| 37 |
}; |
| 38 |
$(window).on("elementor/frontend/init", function() { |
| 39 |
elementorFrontend.hooks.addAction("frontend/element_ready/ma-tabs.default", JLTMA_Tabs); |
| 40 |
}); |
| 41 |
})(jQuery, window.elementorFrontend); |
| 42 |
/** |
| 43 |
* End tabs widget script |
| 44 |
*/ |
| 45 |
//#endregion |
| 46 |
})(); |
| 47 |
|