50 lines
1.5 KiB
JavaScript
50 lines
1.5 KiB
JavaScript
|
(function($) {
|
||
|
|
||
|
"use strict";
|
||
|
var pricing_tab_script_js = function($scope, $) {
|
||
|
|
||
|
if ($("#switch-toggle-tab").length) {
|
||
|
var toggleSwitch = $("#switch-toggle-tab label.switch");
|
||
|
var TabTitle = $("#switch-toggle-tab li");
|
||
|
var monthTabTitle = $("#switch-toggle-tab li.month");
|
||
|
var yearTabTitle = $("#switch-toggle-tab li.year");
|
||
|
var monthTabContent = $("#month");
|
||
|
var yearTabContent = $("#year");
|
||
|
// hidden show deafult;
|
||
|
monthTabContent.fadeIn();
|
||
|
yearTabContent.fadeOut();
|
||
|
|
||
|
function toggleHandle() {
|
||
|
if (toggleSwitch.hasClass("on")) {
|
||
|
monthTabContent.fadeIn();
|
||
|
yearTabContent.fadeOut();
|
||
|
monthTabTitle.addClass("active");
|
||
|
yearTabTitle.removeClass("active");
|
||
|
} else {
|
||
|
monthTabContent.fadeOut();
|
||
|
yearTabContent.fadeIn();
|
||
|
yearTabTitle.addClass("active");
|
||
|
monthTabTitle.removeClass("active");
|
||
|
}
|
||
|
}
|
||
|
monthTabTitle.on("click", function () {
|
||
|
toggleSwitch.addClass("on").removeClass("off");
|
||
|
toggleHandle();
|
||
|
return false;
|
||
|
});
|
||
|
yearTabTitle.on("click", function () {
|
||
|
toggleSwitch.addClass("off").removeClass("on");
|
||
|
toggleHandle();
|
||
|
return false;
|
||
|
});
|
||
|
toggleSwitch.on("click", function () {
|
||
|
toggleSwitch.toggleClass("on off");
|
||
|
toggleHandle();
|
||
|
});
|
||
|
}
|
||
|
};
|
||
|
$(window).on('elementor/frontend/init', function () {
|
||
|
elementorFrontend.hooks.addAction('frontend/element_ready/thinkai_pricing_plan.default', pricing_tab_script_js);
|
||
|
});
|
||
|
|
||
|
})(window.jQuery);
|