jQuery(document).ready(function () {
jQuery(".iti-arrow").hide();
jQuery(".flag-container").click(function (e) {
jQuery(".country-list").addClass("hide");
jQuery(".country-list").hide();
});
jQuery('.price_Box_mobile_view').hide();
if (screen.width < 1000) {
jQuery(window).scroll(function () {
if (jQuery(this).scrollTop() > 400) {
jQuery('.price_Box_mobile_view').show();
jQuery('.price_Box_mobile_view').addClass("price_Box_mobile");
} else {
jQuery('.price_Box_mobile_view').hide();
jQuery('.price_Box_mobile_view').removeClass("price_Box_mobile");
}
});
}
var view_check = jQuery(".view_check").val();
if (view_check == 'active') {
var pano = new pano2vrPlayer("interior_360");
pano.readConfigUrlAsync("../wp-content/plugins/garage-wordpress-plugin/360/tiggo8pro.xml");
if (jQuery(".model_wrap").hasClass("sirio_main")) {
jQuery(".pop_360_rcon").ThreeSixty({
totalFrames: 36,
endFrame: 1,
currentFrame: 36,
imgList: ".threesixty_images",
progress: ".loading-360",
imagePath: "../wp-content/plugins/garage-wordpress-plugin/images/360_view/tiggo8pro/sirio/",
filePrefix: "",
ext: ".png",
width: jQuery(window).outerWidth(),
height: "100%",
navigation: !1,
disableSpin: !1,
responsive: !0,
zeroPadding: true,
speed: 100, // Rotation speed during 'play' mode. Default: 10
inverted: false // Inverts rotation direction
});
}
else if (jQuery(".model_wrap").hasClass("cupis_main")) {
jQuery(".pop_360_rcon").ThreeSixty({
totalFrames: 36,
endFrame: 1,
currentFrame: 36,
imgList: ".threesixty_images",
progress: ".loading-360",
imagePath: "../wp-content/plugins/garage-wordpress-plugin/images/360_view/tiggo8pro/cupis/",
filePrefix: "",
ext: ".png",
width: jQuery(window).outerWidth(),
height: "100%",
navigation: !1,
disableSpin: !1,
responsive: !0,
zeroPadding: true,
});
}
else if (jQuery(".model_wrap").hasClass("iris_main")) {
jQuery(".pop_360_rcon").ThreeSixty({
totalFrames: 36,
endFrame: 1,
currentFrame: 36,
imgList: ".threesixty_images",
progress: ".loading-360",
imagePath: "../wp-content/plugins/garage-wordpress-plugin/images/360_view/tiggo8pro/iris/",
filePrefix: "",
ext: ".png",
width: jQuery(window).outerWidth(),
height: "100%",
navigation: !1,
disableSpin: !1,
responsive: !0,
zeroPadding: true,
});
}
else if (jQuery(".model_wrap").hasClass("venus_main")) {
jQuery(".pop_360_rcon").ThreeSixty({
totalFrames: 36,
endFrame: 1,
currentFrame: 36,
imgList: ".threesixty_images",
progress: ".loading-360",
imagePath: "../wp-content/plugins/garage-wordpress-plugin/images/360_view/tiggo8pro/venus/",
filePrefix: "",
ext: ".png",
width: jQuery(window).outerWidth(),
height: "100%",
navigation: !1,
disableSpin: !1,
responsive: !0,
zeroPadding: true,
});
}
jQuery(".change_E_I span").on("click", function () {
jQuery(".change_E_I span").removeClass("on");
jQuery(this).addClass("on");
switch (jQuery(this).index()) {
case 0:
jQuery("#interior_360").css({ "z-index": -10, opacity: 0 });
jQuery(".color_cut .color").removeClass("off");
jQuery(".color_cut .interior_color").addClass("off");
break;
case 1:
jQuery(".color_cut .color").removeClass("off");
jQuery(".color_cut .exterior_color").addClass("off");
jQuery("#interior_360").css({ "z-index": 10, opacity: 1 });
break;
}
});
}
});
var container = document.getElementById("image_zoom");
var img = container.getElementsByTagName("img")[0];
container.addEventListener("mousemove", onZoom);
container.addEventListener("mouseover", onZoom);
container.addEventListener("mouseleave", offZoom);
function onZoom(e) {
var x = e.clientX - e.target.offsetLeft;
var y = e.clientY - e.target.offsetTop;
img.style.transformOrigin = `${x}px ${y}px`;
img.style.transform = "scale(1.8)";
}
function offZoom(e) {
img.style.transformOrigin = `center center`;
img.style.transform = "scale(1)";
}
jQuery(document).ready(function () {
jQuery('.all2').owlCarousel({
// loop: true,
navigation: true,
autoplay: false,
autoplayTimeout: 5000,
autoplayHoverPause: true,
items: 1,
mousewheel: false,
dots: true,
slideBy: 1,
});
});
jQuery(".btn__right").click(function () {
var owl = jQuery(".all2");
owl.trigger('next.owl.carousel');
});
jQuery(".btn__left").click(function () {
var owl = jQuery(".all2");
owl.trigger('prev.owl.carousel');
});
jQuery(".tab .tab__head li").click(function () {
jQuery(".tab__head li").removeClass("active");
jQuery(this).addClass("active");
var className = jQuery(this).attr('data-class');
jQuery(".tab__body--box").hide();
jQuery("#" + className).slideDown();
});
jQuery(document).ready(function () {
jQuery(".paintBox li").click(function () {
var dataKey = jQuery(this).attr("data-key");
var colorName = jQuery(this).attr("data-name");
var otherColorPrice = parseFloat(jQuery("#other_color_price").val());
var after_change = parseFloat(jQuery("#after_change").val());
var totalValue = parseFloat(jQuery(".pr2").text());
jQuery(".ProductSlider").show();
jQuery(".model_wrap").hide();
if (dataKey == "0") {
var width = jQuery("#width");
var height = jQuery("#height");
if (otherColorPrice == "0" && after_change == "0") {
jQuery(".colorNameDiv").children("b").html(colorName + ":
");
}
if (otherColorPrice != "0" && after_change == "0") {
var total = totalValue + otherColorPrice;
var color_code = jQuery("#chose_color").val();
jQuery(".colorNameDiv").children("b").html(colorName + ": " + color_code + "");
jQuery('#door_color').val(color_code);
// jQuery(".other_color_selct").show();
// jQuery(".other_color_selct").css('background-color',colorCode);
jQuery(".coloreleft").html("" + color_code + ": ");
jQuery(".coloreright").html("€" + otherColorPrice);
jQuery("#after_change").val(otherColorPrice);
jQuery("#other_color_price").val("0");
if (total % 1 !== 0) {
//if number is integer
total = total.toFixed(2);
}
jQuery(".pr").text(total);
jQuery(".pr_mobile").text(total);
jQuery(".totalPrice").val(total);
jQuery(".pr2").text(total);
jQuery('.concessione').each(function () {
if (this.checked) {
var percent = parseInt(jQuery(this).attr("data-percent"));
var totalValue = parseFloat(jQuery(".pr2").text());
var percentValue = totalValue * percent / 100;
var total;
jQuery("#vat_price").val(percentValue);
jQuery(".included_vat").find("span").html("€" + percentValue.toFixed(2));
total = totalValue + percentValue;
if (total % 1 !== 0) {
//if number is integer
total = total.toFixed(2);
}
jQuery(".pr").text(total);
jQuery(".pr_mobile").text(total);
jQuery(".totalPrice").val(total);
}
});
var package_plus = parseFloat(jQuery("#package_plus").val());
if (package_plus > 0) {
var totalOld = parseFloat(jQuery(".pr").text());
var afterAdd = totalOld + package_plus;
if(afterAdd % 1 !== 0){
//if number is integer
afterAdd = afterAdd.toFixed(2);
}
jQuery(".pr").text(afterAdd);
jQuery(".pr_mobile").text(afterAdd);
jQuery(".totalPrice").val(afterAdd);
}
}
if (height.val() != "" && width.val() != "") {
jQuery(".ProductSlider").empty();
jQuery(".garage_doors_images").empty();
var colorName = jQuery(this).attr("data-name");
var color_price = jQuery(this).attr("data-price");
// jQuery(".colorNameDiv").children("span").html("€"+color_price+" per metro quadrato");
jQuery(".paintBox li").removeClass("active");
jQuery(this).addClass("active");
// jQuery(".customColor").slideDown();
jQuery(".ProductSlider").append(
` `
);
jQuery.map(scriptMain, function (val, i) {
if ('multiple' in scriptMain[i]) {
// console.log(scriptMain[i]['multiple']);
jQuery.map(scriptMain[i]['multiple'], function (image, key) {
jQuery(".garage_doors_images").append(
` `
);
});
}
});
jQuery("#my-color")[0].click();
}
else {
swal("AVVISO!", "Compila Prima i Campi Di Larghezza e Altezza!");
}
}else {
jQuery(".ProductSlider ").empty();
jQuery(".garage_doors_images ").empty();
var colorName = jQuery(this).attr("data-name");
jQuery(".colorNameDiv").children("b").text(colorName);
// jQuery(".colorNameDiv").children("span").text(" Included");
jQuery(".coloreleft").html(colorName + " ");
jQuery(".coloreright").html(" €0");
jQuery('#door_color').val(colorName);
jQuery(".paintBox li").removeClass("active");
jQuery(".customColor").slideUp();
jQuery(this).addClass("active");
var counter = 0;
if ('multiple' in scriptMain[dataKey]) {
jQuery.map(scriptMain[dataKey]['multiple'], function (val, i) {
// console.log(i);
jQuery(".garage_doors_images").append(
` `
);
counter++;
});
}
var pandonal_image = scriptMain[dataKey]['ribassata'];
var lucernari_image = scriptMain[dataKey]['window_one_image'];
var rinforzata_image = scriptMain[dataKey]['rinforzata'];
jQuery(".ProductSlider").append(
` `
);
jQuery(".pandonal_image").find("img").attr("src", pandonal_image);
jQuery(".lucernari_image").find("img").attr("src", lucernari_image);
jQuery(".ribassata_image").find("img").attr("src", pandonal_image);
jQuery(".rinforzata_image").find("img").attr("src", rinforzata_image);
jQuery(".lucernari_input").attr("data-key", dataKey);
if (after_change != "0" && otherColorPrice == "0") {
var total = totalValue - after_change;
jQuery("#other_color_price").val(after_change);
jQuery("#after_change").val("0");
if (total % 1 !== 0) {
//if number is integer
total = total.toFixed(2);
}
jQuery(".pr").text(total);
jQuery(".pr_mobile").text(total);
jQuery(".totalPrice").val(total);
jQuery(".pr2").text(total);
jQuery('.concessione').each(function () {
if (this.checked) {
var percent = parseInt(jQuery(this).attr("data-percent"));
var totalValue = parseFloat(jQuery(".pr2").text());
var percentValue = totalValue * percent / 100;
var total;
jQuery("#vat_price").val(percentValue);
jQuery(".included_vat").find("span").html("€" + percentValue.toFixed(2));
total = totalValue + percentValue;
if (total % 1 !== 0) {
//if number is integer
total = total.toFixed(2);
}
jQuery(".pr").text(total);
jQuery(".pr_mobile").text(total);
jQuery(".totalPrice").val(total);
}
});
var package_plus = parseFloat(jQuery("#package_plus").val());
if (package_plus > 0) {
var totalOld = parseFloat(jQuery(".pr").text());
var afterAdd = totalOld + package_plus;
if(afterAdd % 1 !== 0){
//if number is integer
afterAdd = afterAdd.toFixed(2);
}
jQuery(".pr").text(afterAdd);
jQuery(".pr_mobile").text(afterAdd);
jQuery(".totalPrice").val(afterAdd);
}
}
}
jQuery(".ProductSlider").append(`
`);
var swiper = new Swiper(".loopswiper", {
slidesPerView: 6,
spaceBetween: 10,
loop: false,
navigation: {
nextEl: ".swiper-button-next",
prevEl: ".swiper-button-prev",
},
});
});
jQuery('#my-color').change(function () { // <-- use change event
var colorCode = jQuery(this).val();
jQuery(".colorNameDiv").find("span").text(colorCode);
jQuery(".colorNameDiv").find(".other_color_selct").show();
jQuery(".colorNameDiv").find(".other_color_selct").css('background-color', colorCode);
// let result = ntc.name(colorCode);
// let specific_name = result[1];
jQuery("#chose_color").val(colorCode);
jQuery('#door_color').val(colorCode);
var ColorPrice = jQuery("#other_price").val();
jQuery(".coloreleft").html("" + colorCode + ": ");
var otherColorPrice = jQuery("#other_color_price").val();
var after_change = jQuery("#after_change").val();
if (otherColorPrice == "0" && after_change == "0") {
var squarValue = jQuery("#square").val();
if (squarValue != 0) {
var squareVal = parseFloat(squarValue) * parseFloat(ColorPrice);
var totalValue = parseFloat(jQuery(".pr2").text());
if (squareVal % 1 !== 0) {
//if number is integer
squareVal = squareVal.toFixed(2);
}
var total = parseFloat(totalValue) + parseFloat(squareVal);
jQuery("#after_change").val(squareVal);
jQuery(".coloreright").html("€" + squareVal);
if (total % 1 !== 0) {
//if number is integer
total = total.toFixed(2);
}
jQuery(".pr").text(total);
jQuery(".pr_mobile").text(total);
jQuery(".totalPrice").val(total);
jQuery(".pr2").text(total);
jQuery('.concessione').each(function () {
if (this.checked) {
var percent = parseInt(jQuery(this).attr("data-percent"));
var totalValue = parseFloat(jQuery(".pr").text());
var percentValue = totalValue * percent / 100;
var total;
jQuery("#vat_price").val(percentValue);
jQuery(".included_vat").find("span").html("€" + percentValue.toFixed(2));
total = totalValue + percentValue;
if (total % 1 !== 0) {
//if number is integer
total = total.toFixed(2);
}
jQuery(".pr").text(total);
jQuery(".pr_mobile").text(total);
jQuery(".totalPrice").val(total);
}
});
var package_plus = parseFloat(jQuery("#package_plus").val());
if (package_plus > 0) {
var totalOld = parseFloat(jQuery(".pr").text());
var afterAdd = totalOld + package_plus;
if(afterAdd % 1 !== 0){
//if number is integer
afterAdd = afterAdd.toFixed(2);
}
jQuery(".pr").text(afterAdd);
jQuery(".pr_mobile").text(afterAdd);
jQuery(".totalPrice").val(afterAdd);
}
}
}
});
jQuery(".remotecontrollers img").click(function () {
jQuery(".ProductSlider").show();
jQuery(".model_wrap").hide();
var img = jQuery(this).attr("src");
jQuery(".ProductSlider").html(
` `
);
})
jQuery(".btn-form-next").click(function (e) {
e.preventDefault();
if (jQuery("#square").val() != 0) {
scroll({
top: 100
}, "slow")
jQuery(".tab__head li:nth-child(2)").removeClass("active");
jQuery(".tab__head li:nth-child(3)").addClass("active");
jQuery(".tab__body--box:nth-child(2)").hide();
jQuery(".tab__body--box:nth-child(3)").slideDown();
} else {
swal("AVVISO!", "Compila prima tutti i campi del configuratore!");
}
});
jQuery(".btn-form-continue").click(function (e) {
e.preventDefault();
if (jQuery("#square").val() != 0) {
jQuery("html, body").animate({ scrollTop: 200 }, "slow");
var totalPrice = jQuery(".totalPrice").val();
var per_month_price = parseFloat(totalPrice)/24;
per_month_price = parseFloat(per_month_price.toFixed(2));
jQuery("#per_month").html(per_month_price+"€" );
jQuery(".totalP").html("€" + totalPrice);
var vat_price = parseFloat(jQuery("#vat_price").val());
var exl_vat_price = totalPrice - vat_price;
if (exl_vat_price % 1 !== 0) {
//if number is integer
exl_vat_price = parseFloat(exl_vat_price.toFixed(2));
}
jQuery(".quadri").find("span").html("€" + exl_vat_price);
jQuery(".tab__head li:nth-child(1)").removeClass("active");
jQuery(".tab__head li:nth-child(2)").addClass("active");
jQuery(".tab__body--box:nth-child(1)").hide();
jQuery(".tab__body--box:nth-child(2)").slideDown();
if (jQuery(".accessoriUl").has("li").length == 0) {
jQuery(".accessoriUl").hide();
} else {
jQuery(".accessoriUl").show();
}
if (!jQuery(".paintBox").find("li").hasClass("active")) {
scroll({
top: 200
}, "slow");
jQuery(".tab__head li:nth-child(2)").removeClass("active");
jQuery(".tab__head li:nth-child(1)").addClass("active");
jQuery(".tab__body--box:nth-child(2)").hide();
jQuery(".tab__body--box:nth-child(1)").slideDown();
swal("AVVISO!", "Scegli La Colorazione");
}
if (jQuery(".remoteClick").val() == 0) {
jQuery(".tab__head li:nth-child(2)").removeClass("active");
jQuery(".tab__head li:nth-child(1)").addClass("active");
jQuery(".tab__body--box:nth-child(2)").hide();
jQuery(".tab__body--box:nth-child(1)").slideDown();
swal("AVVISO!", "Scegli la quantità del telecomando!");
jQuery(".remoteUl").hide();
} else {
jQuery(".remoteUl").show();
}
var package_plus = parseFloat(jQuery("#package_plus").val());
if (package_plus > 0) {
jQuery(".plus_package").show();
} else {
jQuery(".plus_package").hide();
}
if (jQuery("#iva4").text() == "") {
jQuery(".included_vat").hide();
} else {
jQuery(".included_vat").show();
}
} else {
swal("AVVISO!", "Compila prima tutti i campi del configuratore!");
}
});
jQuery(document).on("click", ".editConfigurator,.sideditbutton", function (e) {
e.preventDefault();
if (jQuery("#square").val() != 0) {
scroll({
top: 200
}, "slow")
jQuery(".tab__head li:nth-child(2)").removeClass("active");
jQuery(".tab__head li:nth-child(1)").addClass("active");
jQuery(".tab__body--box:nth-child(2)").hide();
jQuery(".tab__body--box:nth-child(1)").slideDown();
} else {
swal("AVVISO!", "Compila prima tutti i campi del configuratore!");
}
});
jQuery(".goback").click(function (e) {
e.preventDefault();
if (jQuery("#square").val() != 0) {
scroll({
top: 200
}, "slow")
jQuery(".tab__head li:nth-child(3)").removeClass("active");
jQuery(".tab__head li:nth-child(2)").addClass("active");
jQuery(".tab__body--box:nth-child(3)").hide();
jQuery(".tab__body--box:nth-child(2)").slideDown();
} else {
swal("AVVISO!", "Compila prima tutti i campi del configuratore!");
}
});
jQuery(".PotentialSavings").click(function (e) {
e.preventDefault();
if (jQuery("#square").val() == 0) {
jQuery(".tab__head li:nth-child(3)").removeClass("active");
jQuery(".tab__head li:nth-child(1)").addClass("active");
jQuery(".tab__body--box:nth-child(3)").hide();
jQuery(".tab__body--box:nth-child(1)").slideDown();
swal("AVVISO!", "Compila prima tutti i campi del configuratore!");
}
if (jQuery(".remoteClick").val() == 0) {
jQuery(".tab__head li:nth-child(3)").removeClass("active");
jQuery(".tab__head li:nth-child(1)").addClass("active");
jQuery(".tab__body--box:nth-child(3)").hide();
jQuery(".tab__body--box:nth-child(1)").slideDown();
swal("AVVISO!", "Scegli la quantità del telecomando!");
}
});
jQuery(".contactForm").click(function (e) {
e.preventDefault();
if (jQuery("#square").val() == 0) {
jQuery(".tab__head li:nth-child(4)").removeClass("active");
jQuery(".tab__head li:nth-child(1)").addClass("active");
jQuery(".tab__body--box:nth-child(4)").hide();
jQuery(".tab__body--box:nth-child(1)").slideDown();
swal("AVVISO!", "Compila prima tutti i campi del configuratore!");
}
// if(jQuery(".remoteClick").val() == 0) {
// jQuery(".tab__head li:nth-child(4)").removeClass("active");
// jQuery(".tab__head li:nth-child(1)").addClass("active");
// jQuery(".tab__body--box:nth-child(4)").hide();
// jQuery(".tab__body--box:nth-child(1)").slideDown();
// swal("AVVISO!", "Scegli la quantità del telecomando!")");
// }
});
jQuery(".detailsSection").click(function (e) {
e.preventDefault();
if (jQuery("#square").val() == 0) {
jQuery(".tab__head li:nth-child(2)").removeClass("active");
jQuery(".tab__head li:nth-child(1)").addClass("active");
jQuery(".tab__body--box:nth-child(2)").hide();
jQuery(".tab__body--box:nth-child(1)").slideDown();
swal("AVVISO!", "Compila prima tutti i campi del configuratore!");
} else {
var totalPrice = jQuery(".totalPrice").val();
jQuery(".totalP").html("€" + totalPrice);
var vat_price = parseFloat(jQuery("#vat_price").val());
var exl_vat_price = totalPrice - vat_price;
if (exl_vat_price % 1 !== 0) {
//if number is integer
exl_vat_price = parseFloat(exl_vat_price.toFixed(2));
}
jQuery(".quadri").find("span").html("€" + exl_vat_price);
if (jQuery(".accessoriUl").has("li").length == 0) {
jQuery(".accessoriUl").hide();
} else {
jQuery(".accessoriUl").show();
}
if (!jQuery(".paintBox_").hasClass("active")) {
jQuery(".tab__head li:nth-child(2)").removeClass("active");
jQuery(".tab__head li:nth-child(1)").addClass("active");
jQuery(".tab__body--box:nth-child(2)").hide();
jQuery(".tab__body--box:nth-child(1)").slideDown();
swal("AVVISO!", "Scegli La Colorazione");
}
if (jQuery(".remoteClick").val() == 0) {
jQuery(".tab__head li:nth-child(2)").removeClass("active");
jQuery(".tab__head li:nth-child(1)").addClass("active");
jQuery(".tab__body--box:nth-child(2)").hide();
jQuery(".tab__body--box:nth-child(1)").slideDown();
swal("AVVISO!", "Scegli la quantità del telecomando!");
jQuery(".remoteUl").hide();
} else {
jQuery(".remoteUl").show();
}
if (jQuery("#iva4").text() == "") {
// jQuery(".tab__head li:nth-child(2)").removeClass("active");
// jQuery(".tab__head li:nth-child(1)").addClass("active");
// jQuery(".tab__body--box:nth-child(2)").hide();
// jQuery(".tab__body--box:nth-child(1)").slideDown();
// swal("AVVISO!", "Scegli prima un'aliquota IVA!");
jQuery(".included_vat").hide();
} else {
jQuery(".included_vat").show();
}
}
})
// jQuery(".ProductSlider-next,.ProductSlider-prev").click(function() {
// var ProductSlider = jQuery(".ProductSlider .swiper-slide img");
// for (let index = 0; index < ProductSlider.length -1; index++) {
// jQuery(ProductSlider[index]).attr("src", `../../wp-content/plugins/garage-doors/webImages/Products/${jQuery(".paintBox li.active").attr("data-color")}/${index}.jpg`)
// }
// })
jQuery(".Accessories img").click(function () {
jQuery(".ProductSlider").show();
jQuery(".model_wrap").hide();
var img = jQuery(this).attr("src");
jQuery(".ProductSlider").html(
`
`
);
jQuery(".ProductSlider").append(`
`);
})
})
var swiperS = new Swiper(".remotecontrollersSwiper", {
watchSlidesProgress: true,
slidesPerView: 3,
spaceBetween: 10,
// navigation: {
// nextEl: ".swiper-button-next",
// prevEl: ".swiper-button-prev",
// },
});
var swiper = new Swiper(".Accessories__mainSwiper", {
slidesPerView: 3,
spaceBetween: 10,
// navigation: {
// nextEl: ".swiper-button-next",
// prevEl: ".swiper-button-prev",
// },
});
// jQuery(function () {
// jQuery('[data-toggle="tooltip"]').tooltip({
// trigger: 'hover',
// })
// });
jQuery(document).ready(function () {
{ jQuery(".paintBox li").length > 3 ? jQuery(".paintBox li").addClass("paintBox_") : jQuery(".paintBox li").removeClass("paintBox_") }
{ jQuery(".paintBox li").length > 10 ? jQuery(".paintBox li").addClass("paintBox_2") : jQuery(".paintBox li").removeClass("paintBox_2") }
jQuery(".Accessories__box--Body input").click(function () {
jQuery(".ProductSlider").show();
jQuery(".model_wrap").hide();
var img_ = jQuery(this).closest(".Accessories__box--Body").siblings(".Accessories__box--img").find("img").attr("src");
jQuery(".ProductSlider").html(
` `
);
jQuery(".ProductSlider").append(`
`);
})
// jQuery(".remotecontrollersBox").click(function() {
// jQuery(".ProductSlider").show();
// jQuery(".model_wrap").hide();
// var img_ = jQuery(this).find("img").attr("src");
// jQuery(".ProductSlider").html(
// `
//

//
`
// );
// })
})
jQuery("#close").click(function () {
jQuery(".alertMessage").hide();
});
jQuery(document).on("click", ".spalletta_image,.spalletta_image_old", function (e) {
e.preventDefault();
if (jQuery("#square").val() != 0) {
var default_image = jQuery("#other_image").val();
var default_value = jQuery("#other_image").attr("data-value");
var spelettaImg = jQuery(this).closest(".Accessories__box--Body").siblings(".Accessories__box--img").find("img").attr("src");
var hasClassImage = jQuery(this).parents(".multipleAccessories").find("a").hasClass("spalletta_image");
if (default_image != "" && default_value == 0 && hasClassImage == true) {
jQuery("#other_image").val(spelettaImg);
jQuery("#other_image").attr("data-value", "1");
jQuery(".color_image").find("img").attr("src", default_image);
jQuery(this).parents(".multipleAccessories").find("input").addClass("spalletta_image_old");
jQuery(this).removeClass("spalletta_image");
jQuery(this).closest(".Accessories__box--Body").siblings(".Accessories__box--img").find("img").attr("src", default_image);
} else if (default_image != "" && default_value == 1 && hasClassImage == false) {
jQuery("#other_image").val(spelettaImg);
jQuery("#other_image").attr("data-value", "0");
jQuery(".color_image").find("img").attr("src", default_image);
jQuery(this).parents(".multipleAccessories").find("a").addClass("spalletta_image");
jQuery(this).removeClass("spalletta_image_old");
jQuery(this).closest(".Accessories__box--Body").siblings(".Accessories__box--img").find("img").attr("src", default_image);
}
}
else {
swal("AVVISO!", "Compila Prima i Campi Di Larghezza e Altezza!");
jQuery(this).prop("checked", false);
jQuery(this).removeAttr("checked");
}
});
jQuery(document).ready(function () {
jQuery(".in_boxNo").click(function (e) {
e.preventDefault();
if (jQuery("#square").val() != 0) {
jQuery(this).addClass("active");
if (jQuery(this).siblings(".in_box").find("input").hasClass("pedestrian")) {
// jQuery(this).siblings(".in_box").find("input").prop("checked", false);
jQuery(".pedestrian_inner").slideUp();
}
if (jQuery(this).siblings(".in_box").find("input").hasClass("lucernari")) {
jQuery(".lucernari_main").slideUp();
}
jQuery(this).siblings(".in_box").removeClass("active");
// jQuery(this).siblings(".in_box").find("input").prop("checked", false);
jQuery(this).closest(".Accessories__b").removeClass("active");
}
else {
swal("AVVISO!", "Compila Prima i Campi Di Larghezza e Altezza!");
// jQuery(this).prop("checked", false);
jQuery(this).removeAttr("checked");
}
})
// close
jQuery(".Accessories__mm .pedestrianRadio").click(function (e) {
jQuery(".Accessories__mm .Accessories__b").removeClass("active");
jQuery(".Accessories__mm .in_box").removeClass("active");
jQuery(this).closest(".in_box").addClass("active");
jQuery(this).closest(".Accessories__b").addClass("active");
})
})
jQuery(".pedestrian").closest(".Accessories__b").addClass("Accessoriespedestrian");
jQuery(".pedestrian").closest(".lucernari").addClass("Accessoriespedestrian2");
jQuery(".remotecontrollers_top").click(function (e) {
e.stopPropagation();
if (jQuery("#square").val() != 0) {
jQuery(".remotecontrollers_Body").slideToggle();
}
else {
swal("AVVISO!", "Compila Prima i Campi Di Larghezza e Altezza!");
jQuery(this).prop("checked", false);
jQuery(this).removeAttr("checked");
}
})
var defimg = jQuery(this).siblings("img").attr("src");
var defspan = jQuery(this).siblings("span").html();
jQuery(document).click(function (e) {
if (jQuery(e.target).hasClass('remoteClick')) {
}
else {
jQuery(".remotecontrollers_Body").hide();
}
})
if (screen.width > 1000) {
jQuery(window).ready(function () {
if (jQuery('.product__left').length) {
var windowh = jQuery(window).height();
var filter = jQuery('.product__left').height();
var coord = windowh - filter;
var sidebar = new StickySidebar('.product__left', {
containerSelector: '.productBlock',
innerWrapperSelector: '.product__left-in',
topSpacing: 60,
// bottomSpacing: 20
});
};
// jQuery(".product__left-in").sticky({topSpacing:20});
});
}
jQuery(".lucernari").click(function () {
if (jQuery("#square").val() != 0) {
jQuery(".lucernari_main").slideDown();
jQuery(".pedestrian_inner").hide();
}
})
jQuery(document).on("click", ".sidmedia", function () {
var img = jQuery(this).find("img").attr("src")
jQuery(".color_image img").attr("src", img);
})
var swiper = new Swiper(".loopswiper", {
slidesPerView: 6,
spaceBetween: 10,
loop: false,
navigation: {
nextEl: ".swiper-button-next",
prevEl: ".swiper-button-prev",
},
});
jQuery(".swiper-button-next").click(function () {
if (jQuery("[name=othercolor]").parent(".paintBox_").hasClass("active")) {
const myTimeout = setTimeout(myGreeting, 20);
}
function myGreeting() {
jQuery(".swiper-button-disabled").removeClass("swiper-button-disabled");
}
})
jQuery(function () {
jQuery("#datepicker").datepicker({
monthNames: ["Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno",
"Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre"],
dayNamesMin: ["Do", "Lu", "Ma", "Me", "Gi", "Ve", "Sa"],
dateFormat: "dd MM yy",
firstDay: 1,
minDate: 1,
beforeShowDay: jQuery.datepicker.noWeekends,
isRTL: false
});
});
jQuery(".bank_transfer_btn").click(function (e) {
e.preventDefault();
jQuery("#bank_transfer").slideDown();
});
jQuery("#iva_number").on("input", function () {
var inputValue = jQuery(this).val();
jQuery("#iva_number2").val(inputValue);
});
jQuery("#sdi_pec").on("input", function () {
var inputValue = jQuery(this).val();
jQuery("#sdi_pec2").val(inputValue);
});
jQuery("#indirizzo").on("input", function () {
var inputValue = jQuery(this).val();
jQuery("#indirizzo2").val(inputValue);
});
jQuery("#datepicker").on("change", function () {
var inputValue = jQuery(this).val();
jQuery("#starting_date").val(inputValue);
});
jQuery(".pay_now").click(function (e) {
var iva_numer = jQuery("#iva_number").val();
if (iva_numer == "") {
e.preventDefault();
jQuery(".iva_error").remove();
jQuery("Il campo e richiesto.").insertAfter(".iva_number");
scroll({
top: 200
}, "slow");
} else {
jQuery(".bank-transfer-spinner").show();
}
});
jQuery(".mail_btn").click(function (e) {
var phone_code = jQuery(".selected-flag").attr("title");
var arr = phone_code.split("+");
jQuery(".wpcf7-phonetext-country-code").val(arr[1]);
var btnClickValue = jQuery(this).attr("data-click");
var user_name = jQuery(".user_name").val();
var user_phone = jQuery(".user_phone").val();
var user_email = jQuery(".user_email").val();
if (user_name != "" && user_phone != "" && user_email != "" && btnClickValue == '1') {
jQuery(this).attr("data-click", "0");
jQuery(".mail-spinner").show();
}
if (user_name != "" && user_phone != "" && user_email != "" && btnClickValue == '0') {
e.preventDefault();
}
});
jQuery(".flag-container").click(function (e) {
alert("OK");
jQuery(".country-list").addClass("hide");
jQuery(".country-list").hide();
jQuery(".iti-arrow").hide();
});
jQuery("#plus_checkmark").click(function (e) {
e.stopPropagation();
if (jQuery("#square").val() != 0) {
var inputValue = parseInt(jQuery(this).val());
var totalPrice = parseFloat(jQuery(".pr").text());
if (this.checked) {
totalValue = totalPrice + inputValue;
jQuery("#package_plus").val(inputValue);
}else{
totalValue = totalPrice - inputValue;
jQuery("#package_plus").val("0");
}
total = totalValue.toFixed(2);
jQuery(".totalPrice").val(total);
jQuery(".pr").text(total);
jQuery(".pr_mobile").text(total);
}else {
jQuery("#package_plus").val("no");
swal("AVVISO!", "Compila Prima i Campi Di Larghezza e Altezza!");
jQuery(this).prop("checked", false);
jQuery(this).removeAttr("checked");
}
})