logistic uploaded for doormile
This commit is contained in:
39
assets/javascript/tabs-widget.js
Normal file
39
assets/javascript/tabs-widget.js
Normal file
@@ -0,0 +1,39 @@
|
||||
"use strict";
|
||||
jQuery(window).on("elementor/frontend/init", function() {
|
||||
elementorFrontend.hooks.addAction("frontend/element_ready/logico_tabs.default", function(e) {
|
||||
let i, t, a = e.find(".logico-video-trigger-button"), n = e.find(".logico-video-container"), r = e.find(".logico-video-wrapper"), o = e.find(".logico-close-popup-layer"), u = jQuery(r).attr("data-src"), d = e.find(".logico-tabs-titles-container"), s = e.find(".logico-tabs-content-container");
|
||||
jQuery(d).find(".logico-tab-title-item").first().addClass("active"),
|
||||
jQuery(s).find(".logico-tab-content-item").first().addClass("active"),
|
||||
e.find(".logico-tab-title-item a").on("click", function() {
|
||||
let e = jQuery(this).parent().attr("data-id");
|
||||
jQuery(this).parent().is(".active") || (d.find(".active").removeClass("active"),
|
||||
s.find(".active").removeClass("active"),
|
||||
jQuery(this).parent().addClass("active"),
|
||||
s.find("#" + e).addClass("active"))
|
||||
}),
|
||||
jQuery(a).on("click", function() {
|
||||
jQuery(n).addClass("active"),
|
||||
setTimeout(function() {
|
||||
i = jQuery(r).height(),
|
||||
t = i * (16 / 9),
|
||||
jQuery(r).width(t),
|
||||
jQuery(r).append('<iframe frameborder="0" allowfullscreen="1" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" title="YouTube video player" width="100%" height="100%" src="' + u + '?playlist=ZdXao5XqeqM&iv_load_policy=3&enablejsapi=1&disablekb=1&autoplay=1&controls=1&showinfo=0&rel=0&loop=0&wmode=transparent"></iframe>')
|
||||
}, 100),
|
||||
setTimeout(function() {
|
||||
jQuery(n).addClass("visible")
|
||||
}, 500)
|
||||
}),
|
||||
jQuery(o).on("click", function() {
|
||||
jQuery(n).removeClass("visible"),
|
||||
setTimeout(function() {
|
||||
jQuery(r).html(""),
|
||||
jQuery(n).removeClass("active")
|
||||
}, 500)
|
||||
}),
|
||||
jQuery(window).on("resize", function() {
|
||||
i = jQuery(r).height(),
|
||||
t = i * (16 / 9),
|
||||
jQuery(r).width(t)
|
||||
})
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user