$(document).ready(function () {
$(".iti-arrow").hide();
$(".flag-container").click(function (e) {
$(".country-list").addClass("hide");
$(".country-list").hide();
});
$('.price_Box_mobile_view').hide();
if (screen.width < 1000) {
$(window).scroll(function () {
if ($(this).scrollTop() > 400) {
$('.price_Box_mobile_view').show();
$('.price_Box_mobile_view').addClass("price_Box_mobile");
} else {
$('.price_Box_mobile_view').hide();
$('.price_Box_mobile_view').removeClass("price_Box_mobile");
}
});
}
var view_check = $(".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 ($(".model_wrap").hasClass("sirio_main")) {
$(".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: $(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 ($(".model_wrap").hasClass("cupis_main")) {
$(".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: $(window).outerWidth(),
height: "100%",
navigation: !1,
disableSpin: !1,
responsive: !0,
zeroPadding: true,
});
}
else if ($(".model_wrap").hasClass("iris_main")) {
$(".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: $(window).outerWidth(),
height: "100%",
navigation: !1,
disableSpin: !1,
responsive: !0,
zeroPadding: true,
});
}
else if ($(".model_wrap").hasClass("venus_main")) {
$(".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: $(window).outerWidth(),
height: "100%",
navigation: !1,
disableSpin: !1,
responsive: !0,
zeroPadding: true,
});
}
$(".change_E_I span").on("click", function () {
$(".change_E_I span").removeClass("on");
$(this).addClass("on");
switch ($(this).index()) {
case 0:
$("#interior_360").css({ "z-index": -10, opacity: 0 });
$(".color_cut .color").removeClass("off");
$(".color_cut .interior_color").addClass("off");
break;
case 1:
$(".color_cut .color").removeClass("off");
$(".color_cut .exterior_color").addClass("off");
$("#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)";
}
$(document).ready(function () {
$('.all2').owlCarousel({
// loop: true,
navigation: true,
autoplay: false,
autoplayTimeout: 5000,
autoplayHoverPause: true,
items: 1,
mousewheel: false,
dots: true,
slideBy: 1,
});
});
$(".btn__right").click(function () {
var owl = $(".all2");
owl.trigger('next.owl.carousel');
});
$(".btn__left").click(function () {
var owl = $(".all2");
owl.trigger('prev.owl.carousel');
});
$(".tab .tab__head li").click(function () {
$(".tab__head li").removeClass("active");
$(this).addClass("active");
var className = $(this).attr('data-class');
$(".tab__body--box").hide();
$("#" + className).slideDown();
});
$(document).ready(function () {
$(".paintBox li").click(function () {
var dataKey = $(this).attr("data-key");
var colorName = $(this).attr("data-name");
var otherColorPrice = parseFloat($("#other_color_price").val());
var after_change = parseFloat($("#after_change").val());
var totalValue = parseFloat($(".pr2").text());
$(".ProductSlider").show();
$(".model_wrap").hide();
if (dataKey == "0") {
var width = $("#width");
var height = $("#height");
if (otherColorPrice == "0" && after_change == "0") {
$(".colorNameDiv").children("b").html(colorName + ":
");
}
if (otherColorPrice != "0" && after_change == "0") {
var total = totalValue + otherColorPrice;
var color_code = $("#chose_color").val();
$(".colorNameDiv").children("b").html(colorName + ": " + color_code + "");
$('#door_color').val(color_code);
// $(".other_color_selct").show();
// $(".other_color_selct").css('background-color',colorCode);
$(".coloreleft").html("" + color_code + ": ");
$(".coloreright").html("€" + otherColorPrice);
$("#after_change").val(otherColorPrice);
$("#other_color_price").val("0");
if (total % 1 !== 0) {
//if number is integer
total = total.toFixed(2);
}
$(".pr").text(total);
$(".pr_mobile").text(total);
$(".totalPrice").val(total);
$(".pr2").text(total);
$('.concessione').each(function () {
if (this.checked) {
var percent = parseInt($(this).attr("data-percent"));
var totalValue = parseFloat($(".pr2").text());
var percentValue = totalValue * percent / 100;
var total;
$("#vat_price").val(percentValue);
$(".included_vat").find("span").html("€" + percentValue.toFixed(2));
total = totalValue + percentValue;
if (total % 1 !== 0) {
//if number is integer
total = total.toFixed(2);
}
$(".pr").text(total);
$(".pr_mobile").text(total);
$(".totalPrice").val(total);
}
});
var package_plus = parseFloat($("#package_plus").val());
if (package_plus > 0) {
var totalOld = parseFloat($(".pr").text());
var afterAdd = totalOld + package_plus;
if(afterAdd % 1 !== 0){
//if number is integer
afterAdd = afterAdd.toFixed(2);
}
$(".pr").text(afterAdd);
$(".pr_mobile").text(afterAdd);
$(".totalPrice").val(afterAdd);
}
}
if (height.val() != "" && width.val() != "") {
$(".ProductSlider").empty();
$(".garage_doors_images").empty();
var colorName = $(this).attr("data-name");
var color_price = $(this).attr("data-price");
// $(".colorNameDiv").children("span").html("€"+color_price+" per metro quadrato");
$(".paintBox li").removeClass("active");
$(this).addClass("active");
// $(".customColor").slideDown();
$(".ProductSlider").append(
` `
);
$.map(scriptMain, function (val, i) {
if ('multiple' in scriptMain[i]) {
// console.log(scriptMain[i]['multiple']);
$.map(scriptMain[i]['multiple'], function (image, key) {
$(".garage_doors_images").append(
` `
);
});
}
});
$("#my-color")[0].click();
}
else {
swal("AVVISO!", "Compila Prima i Campi Di Larghezza e Altezza!");
}
}else {
$(".ProductSlider ").empty();
$(".garage_doors_images ").empty();
var colorName = $(this).attr("data-name");
$(".colorNameDiv").children("b").text(colorName);
// $(".colorNameDiv").children("span").text(" Included");
$(".coloreleft").html(colorName + " ");
$(".coloreright").html(" €0");
$('#door_color').val(colorName);
$(".paintBox li").removeClass("active");
$(".customColor").slideUp();
$(this).addClass("active");
var counter = 0;
if ('multiple' in scriptMain[dataKey]) {
$.map(scriptMain[dataKey]['multiple'], function (val, i) {
// console.log(i);
$(".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'];
$(".ProductSlider").append(
` `
);
$(".pandonal_image").find("img").attr("src", pandonal_image);
$(".lucernari_image").find("img").attr("src", lucernari_image);
$(".ribassata_image").find("img").attr("src", pandonal_image);
$(".rinforzata_image").find("img").attr("src", rinforzata_image);
$(".lucernari_input").attr("data-key", dataKey);
if (after_change != "0" && otherColorPrice == "0") {
var total = totalValue - after_change;
$("#other_color_price").val(after_change);
$("#after_change").val("0");
if (total % 1 !== 0) {
//if number is integer
total = total.toFixed(2);
}
$(".pr").text(total);
$(".pr_mobile").text(total);
$(".totalPrice").val(total);
$(".pr2").text(total);
$('.concessione').each(function () {
if (this.checked) {
var percent = parseInt($(this).attr("data-percent"));
var totalValue = parseFloat($(".pr2").text());
var percentValue = totalValue * percent / 100;
var total;
$("#vat_price").val(percentValue);
$(".included_vat").find("span").html("€" + percentValue.toFixed(2));
total = totalValue + percentValue;
if (total % 1 !== 0) {
//if number is integer
total = total.toFixed(2);
}
$(".pr").text(total);
$(".pr_mobile").text(total);
$(".totalPrice").val(total);
}
});
var package_plus = parseFloat($("#package_plus").val());
if (package_plus > 0) {
var totalOld = parseFloat($(".pr").text());
var afterAdd = totalOld + package_plus;
if(afterAdd % 1 !== 0){
//if number is integer
afterAdd = afterAdd.toFixed(2);
}
$(".pr").text(afterAdd);
$(".pr_mobile").text(afterAdd);
$(".totalPrice").val(afterAdd);
}
}
}
$(".ProductSlider").append(`
`);
var swiper = new Swiper(".loopswiper", {
slidesPerView: 6,
spaceBetween: 10,
loop: false,
navigation: {
nextEl: ".swiper-button-next",
prevEl: ".swiper-button-prev",
},
});
});
$('#my-color').change(function () { // <-- use change event
var colorCode = $(this).val();
$(".colorNameDiv").find("span").text(colorCode);
$(".colorNameDiv").find(".other_color_selct").show();
$(".colorNameDiv").find(".other_color_selct").css('background-color', colorCode);
// let result = ntc.name(colorCode);
// let specific_name = result[1];
$("#chose_color").val(colorCode);
$('#door_color').val(colorCode);
var ColorPrice = $("#other_price").val();
$(".coloreleft").html("" + colorCode + ": ");
var otherColorPrice = $("#other_color_price").val();
var after_change = $("#after_change").val();
if (otherColorPrice == "0" && after_change == "0") {
var squarValue = $("#square").val();
if (squarValue != 0) {
var squareVal = parseFloat(squarValue) * parseFloat(ColorPrice);
var totalValue = parseFloat($(".pr2").text());
if (squareVal % 1 !== 0) {
//if number is integer
squareVal = squareVal.toFixed(2);
}
var total = parseFloat(totalValue) + parseFloat(squareVal);
$("#after_change").val(squareVal);
$(".coloreright").html("€" + squareVal);
if (total % 1 !== 0) {
//if number is integer
total = total.toFixed(2);
}
$(".pr").text(total);
$(".pr_mobile").text(total);
$(".totalPrice").val(total);
$(".pr2").text(total);
$('.concessione').each(function () {
if (this.checked) {
var percent = parseInt($(this).attr("data-percent"));
var totalValue = parseFloat($(".pr").text());
var percentValue = totalValue * percent / 100;
var total;
$("#vat_price").val(percentValue);
$(".included_vat").find("span").html("€" + percentValue.toFixed(2));
total = totalValue + percentValue;
if (total % 1 !== 0) {
//if number is integer
total = total.toFixed(2);
}
$(".pr").text(total);
$(".pr_mobile").text(total);
$(".totalPrice").val(total);
}
});
var package_plus = parseFloat($("#package_plus").val());
if (package_plus > 0) {
var totalOld = parseFloat($(".pr").text());
var afterAdd = totalOld + package_plus;
if(afterAdd % 1 !== 0){
//if number is integer
afterAdd = afterAdd.toFixed(2);
}
$(".pr").text(afterAdd);
$(".pr_mobile").text(afterAdd);
$(".totalPrice").val(afterAdd);
}
}
}
});
$(".remotecontrollers img").click(function () {
$(".ProductSlider").show();
$(".model_wrap").hide();
var img = $(this).attr("src");
$(".ProductSlider").html(
` `
);
})
$(".btn-form-next").click(function (e) {
e.preventDefault();
if ($("#square").val() != 0) {
scroll({
top: 100
}, "slow")
$(".tab__head li:nth-child(2)").removeClass("active");
$(".tab__head li:nth-child(3)").addClass("active");
$(".tab__body--box:nth-child(2)").hide();
$(".tab__body--box:nth-child(3)").slideDown();
} else {
swal("AVVISO!", "Compila prima tutti i campi del configuratore!");
}
});
$(".btn-form-continue").click(function (e) {
e.preventDefault();
if ($("#square").val() != 0) {
$("html, body").animate({ scrollTop: 200 }, "slow");
var totalPrice = $(".totalPrice").val();
var per_month_price = parseFloat(totalPrice)/24;
per_month_price = parseFloat(per_month_price.toFixed(2));
$("#per_month").html(per_month_price+"€" );
$(".totalP").html("€" + totalPrice);
var vat_price = parseFloat($("#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));
}
$(".quadri").find("span").html("€" + exl_vat_price);
$(".tab__head li:nth-child(1)").removeClass("active");
$(".tab__head li:nth-child(2)").addClass("active");
$(".tab__body--box:nth-child(1)").hide();
$(".tab__body--box:nth-child(2)").slideDown();
if ($(".accessoriUl").has("li").length == 0) {
$(".accessoriUl").hide();
} else {
$(".accessoriUl").show();
}
if (!$(".paintBox").find("li").hasClass("active")) {
scroll({
top: 200
}, "slow");
$(".tab__head li:nth-child(2)").removeClass("active");
$(".tab__head li:nth-child(1)").addClass("active");
$(".tab__body--box:nth-child(2)").hide();
$(".tab__body--box:nth-child(1)").slideDown();
swal("AVVISO!", "Scegli La Colorazione");
}
if ($(".remoteClick").val() == 0) {
$(".tab__head li:nth-child(2)").removeClass("active");
$(".tab__head li:nth-child(1)").addClass("active");
$(".tab__body--box:nth-child(2)").hide();
$(".tab__body--box:nth-child(1)").slideDown();
swal("AVVISO!", "Scegli la quantità del telecomando!");
$(".remoteUl").hide();
} else {
$(".remoteUl").show();
}
var package_plus = parseFloat($("#package_plus").val());
if (package_plus > 0) {
$(".plus_package").show();
} else {
$(".plus_package").hide();
}
if ($("#iva4").text() == "") {
$(".included_vat").hide();
} else {
$(".included_vat").show();
}
} else {
swal("AVVISO!", "Compila prima tutti i campi del configuratore!");
}
});
$(document).on("click", ".editConfigurator,.sideditbutton", function (e) {
e.preventDefault();
if ($("#square").val() != 0) {
scroll({
top: 200
}, "slow")
$(".tab__head li:nth-child(2)").removeClass("active");
$(".tab__head li:nth-child(1)").addClass("active");
$(".tab__body--box:nth-child(2)").hide();
$(".tab__body--box:nth-child(1)").slideDown();
} else {
swal("AVVISO!", "Compila prima tutti i campi del configuratore!");
}
});
$(".goback").click(function (e) {
e.preventDefault();
if ($("#square").val() != 0) {
scroll({
top: 200
}, "slow")
$(".tab__head li:nth-child(3)").removeClass("active");
$(".tab__head li:nth-child(2)").addClass("active");
$(".tab__body--box:nth-child(3)").hide();
$(".tab__body--box:nth-child(2)").slideDown();
} else {
swal("AVVISO!", "Compila prima tutti i campi del configuratore!");
}
});
$(".PotentialSavings").click(function (e) {
e.preventDefault();
if ($("#square").val() == 0) {
$(".tab__head li:nth-child(3)").removeClass("active");
$(".tab__head li:nth-child(1)").addClass("active");
$(".tab__body--box:nth-child(3)").hide();
$(".tab__body--box:nth-child(1)").slideDown();
swal("AVVISO!", "Compila prima tutti i campi del configuratore!");
}
if ($(".remoteClick").val() == 0) {
$(".tab__head li:nth-child(3)").removeClass("active");
$(".tab__head li:nth-child(1)").addClass("active");
$(".tab__body--box:nth-child(3)").hide();
$(".tab__body--box:nth-child(1)").slideDown();
swal("AVVISO!", "Scegli la quantità del telecomando!");
}
});
$(".contactForm").click(function (e) {
e.preventDefault();
if ($("#square").val() == 0) {
$(".tab__head li:nth-child(4)").removeClass("active");
$(".tab__head li:nth-child(1)").addClass("active");
$(".tab__body--box:nth-child(4)").hide();
$(".tab__body--box:nth-child(1)").slideDown();
swal("AVVISO!", "Compila prima tutti i campi del configuratore!");
}
// if($(".remoteClick").val() == 0) {
// $(".tab__head li:nth-child(4)").removeClass("active");
// $(".tab__head li:nth-child(1)").addClass("active");
// $(".tab__body--box:nth-child(4)").hide();
// $(".tab__body--box:nth-child(1)").slideDown();
// swal("AVVISO!", "Scegli la quantità del telecomando!")");
// }
});
$(".detailsSection").click(function (e) {
e.preventDefault();
if ($("#square").val() == 0) {
$(".tab__head li:nth-child(2)").removeClass("active");
$(".tab__head li:nth-child(1)").addClass("active");
$(".tab__body--box:nth-child(2)").hide();
$(".tab__body--box:nth-child(1)").slideDown();
swal("AVVISO!", "Compila prima tutti i campi del configuratore!");
} else {
var totalPrice = $(".totalPrice").val();
$(".totalP").html("€" + totalPrice);
var vat_price = parseFloat($("#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));
}
$(".quadri").find("span").html("€" + exl_vat_price);
if ($(".accessoriUl").has("li").length == 0) {
$(".accessoriUl").hide();
} else {
$(".accessoriUl").show();
}
if (!$(".paintBox_").hasClass("active")) {
$(".tab__head li:nth-child(2)").removeClass("active");
$(".tab__head li:nth-child(1)").addClass("active");
$(".tab__body--box:nth-child(2)").hide();
$(".tab__body--box:nth-child(1)").slideDown();
swal("AVVISO!", "Scegli La Colorazione");
}
if ($(".remoteClick").val() == 0) {
$(".tab__head li:nth-child(2)").removeClass("active");
$(".tab__head li:nth-child(1)").addClass("active");
$(".tab__body--box:nth-child(2)").hide();
$(".tab__body--box:nth-child(1)").slideDown();
swal("AVVISO!", "Scegli la quantità del telecomando!");
$(".remoteUl").hide();
} else {
$(".remoteUl").show();
}
if ($("#iva4").text() == "") {
// $(".tab__head li:nth-child(2)").removeClass("active");
// $(".tab__head li:nth-child(1)").addClass("active");
// $(".tab__body--box:nth-child(2)").hide();
// $(".tab__body--box:nth-child(1)").slideDown();
// swal("AVVISO!", "Scegli prima un'aliquota IVA!");
$(".included_vat").hide();
} else {
$(".included_vat").show();
}
}
})
// $(".ProductSlider-next,.ProductSlider-prev").click(function() {
// var ProductSlider = $(".ProductSlider .swiper-slide img");
// for (let index = 0; index < ProductSlider.length -1; index++) {
// $(ProductSlider[index]).attr("src", `../../wp-content/plugins/garage-doors/webImages/Products/${$(".paintBox li.active").attr("data-color")}/${index}.jpg`)
// }
// })
$(".Accessories img").click(function () {
$(".ProductSlider").show();
$(".model_wrap").hide();
var img = $(this).attr("src");
$(".ProductSlider").html(
`
`
);
$(".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",
// },
});
// $(function () {
// $('[data-toggle="tooltip"]').tooltip({
// trigger: 'hover',
// })
// });
$(document).ready(function () {
{ $(".paintBox li").length > 3 ? $(".paintBox li").addClass("paintBox_") : $(".paintBox li").removeClass("paintBox_") }
{ $(".paintBox li").length > 10 ? $(".paintBox li").addClass("paintBox_2") : $(".paintBox li").removeClass("paintBox_2") }
$(".Accessories__box--Body input").click(function () {
$(".ProductSlider").show();
$(".model_wrap").hide();
var img_ = $(this).closest(".Accessories__box--Body").siblings(".Accessories__box--img").find("img").attr("src");
$(".ProductSlider").html(
` `
);
$(".ProductSlider").append(`
`);
})
// $(".remotecontrollersBox").click(function() {
// $(".ProductSlider").show();
// $(".model_wrap").hide();
// var img_ = $(this).find("img").attr("src");
// $(".ProductSlider").html(
// `
//
//
`
// );
// })
})
$("#close").click(function () {
$(".alertMessage").hide();
});
$(document).on("click", ".spalletta_image,.spalletta_image_old", function (e) {
e.preventDefault();
if ($("#square").val() != 0) {
var default_image = $("#other_image").val();
var default_value = $("#other_image").attr("data-value");
var spelettaImg = $(this).closest(".Accessories__box--Body").siblings(".Accessories__box--img").find("img").attr("src");
var hasClassImage = $(this).parents(".multipleAccessories").find("a").hasClass("spalletta_image");
if (default_image != "" && default_value == 0 && hasClassImage == true) {
$("#other_image").val(spelettaImg);
$("#other_image").attr("data-value", "1");
$(".color_image").find("img").attr("src", default_image);
$(this).parents(".multipleAccessories").find("input").addClass("spalletta_image_old");
$(this).removeClass("spalletta_image");
$(this).closest(".Accessories__box--Body").siblings(".Accessories__box--img").find("img").attr("src", default_image);
} else if (default_image != "" && default_value == 1 && hasClassImage == false) {
$("#other_image").val(spelettaImg);
$("#other_image").attr("data-value", "0");
$(".color_image").find("img").attr("src", default_image);
$(this).parents(".multipleAccessories").find("a").addClass("spalletta_image");
$(this).removeClass("spalletta_image_old");
$(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!");
$(this).prop("checked", false);
$(this).removeAttr("checked");
}
});
$(document).ready(function () {
$(".in_boxNo").click(function (e) {
e.preventDefault();
if ($("#square").val() != 0) {
$(this).addClass("active");
if ($(this).siblings(".in_box").find("input").hasClass("pedestrian")) {
// $(this).siblings(".in_box").find("input").prop("checked", false);
$(".pedestrian_inner").slideUp();
}
if ($(this).siblings(".in_box").find("input").hasClass("lucernari")) {
$(".lucernari_main").slideUp();
}
$(this).siblings(".in_box").removeClass("active");
// $(this).siblings(".in_box").find("input").prop("checked", false);
$(this).closest(".Accessories__b").removeClass("active");
}
else {
swal("AVVISO!", "Compila Prima i Campi Di Larghezza e Altezza!");
// $(this).prop("checked", false);
$(this).removeAttr("checked");
}
})
// close
$(".Accessories__mm .pedestrianRadio").click(function (e) {
$(".Accessories__mm .Accessories__b").removeClass("active");
$(".Accessories__mm .in_box").removeClass("active");
$(this).closest(".in_box").addClass("active");
$(this).closest(".Accessories__b").addClass("active");
})
})
$(".pedestrian").closest(".Accessories__b").addClass("Accessoriespedestrian");
$(".pedestrian").closest(".lucernari").addClass("Accessoriespedestrian2");
$(".remotecontrollers_top").click(function (e) {
e.stopPropagation();
if ($("#square").val() != 0) {
$(".remotecontrollers_Body").slideToggle();
}
else {
swal("AVVISO!", "Compila Prima i Campi Di Larghezza e Altezza!");
$(this).prop("checked", false);
$(this).removeAttr("checked");
}
})
var defimg = $(this).siblings("img").attr("src");
var defspan = $(this).siblings("span").html();
$(document).click(function (e) {
if ($(e.target).hasClass('remoteClick')) {
}
else {
$(".remotecontrollers_Body").hide();
}
})
if (screen.width > 1000) {
$(window).ready(function () {
if ($('.product__left').length) {
var windowh = $(window).height();
var filter = $('.product__left').height();
var coord = windowh - filter;
var sidebar = new StickySidebar('.product__left', {
containerSelector: '.productBlock',
innerWrapperSelector: '.product__left-in',
topSpacing: 60,
// bottomSpacing: 20
});
};
// $(".product__left-in").sticky({topSpacing:20});
});
}
$(".lucernari").click(function () {
if ($("#square").val() != 0) {
$(".lucernari_main").slideDown();
$(".pedestrian_inner").hide();
}
})
$(document).on("click", ".sidmedia", function () {
var img = $(this).find("img").attr("src")
$(".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",
},
});
$(".swiper-button-next").click(function () {
if ($("[name=othercolor]").parent(".paintBox_").hasClass("active")) {
const myTimeout = setTimeout(myGreeting, 20);
}
function myGreeting() {
$(".swiper-button-disabled").removeClass("swiper-button-disabled");
}
})
$(function () {
$("#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: $.datepicker.noWeekends,
isRTL: false
});
});
$(".bank_transfer_btn").click(function (e) {
e.preventDefault();
$("#bank_transfer").slideDown();
});
$("#iva_number").on("input", function () {
var inputValue = $(this).val();
$("#iva_number2").val(inputValue);
});
$("#sdi_pec").on("input", function () {
var inputValue = $(this).val();
$("#sdi_pec2").val(inputValue);
});
$("#indirizzo").on("input", function () {
var inputValue = $(this).val();
$("#indirizzo2").val(inputValue);
});
$("#datepicker").on("change", function () {
var inputValue = $(this).val();
$("#starting_date").val(inputValue);
});
$(".pay_now").click(function (e) {
var iva_numer = $("#iva_number").val();
if (iva_numer == "") {
e.preventDefault();
$(".iva_error").remove();
$("Il campo e richiesto.").insertAfter(".iva_number");
scroll({
top: 200
}, "slow");
} else {
$(".bank-transfer-spinner").show();
}
});
$(".mail_btn").click(function (e) {
var phone_code = $(".selected-flag").attr("title");
var arr = phone_code.split("+");
$(".wpcf7-phonetext-country-code").val(arr[1]);
var btnClickValue = $(this).attr("data-click");
var user_name = $(".user_name").val();
var user_phone = $(".user_phone").val();
var user_email = $(".user_email").val();
if (user_name != "" && user_phone != "" && user_email != "" && btnClickValue == '1') {
$(this).attr("data-click", "0");
$(".mail-spinner").show();
}
if (user_name != "" && user_phone != "" && user_email != "" && btnClickValue == '0') {
e.preventDefault();
}
});
$(".flag-container").click(function (e) {
alert("OK");
$(".country-list").addClass("hide");
$(".country-list").hide();
$(".iti-arrow").hide();
});
$("#plus_checkmark").click(function (e) {
e.stopPropagation();
if ($("#square").val() != 0) {
var inputValue = parseInt($(this).val());
var totalPrice = parseFloat($(".pr").text());
if (this.checked) {
totalValue = totalPrice + inputValue;
$("#package_plus").val(inputValue);
}else{
totalValue = totalPrice - inputValue;
$("#package_plus").val("0");
}
total = totalValue.toFixed(2);
$(".totalPrice").val(total);
$(".pr").text(total);
$(".pr_mobile").text(total);
}else {
$("#package_plus").val("no");
swal("AVVISO!", "Compila Prima i Campi Di Larghezza e Altezza!");
$(this).prop("checked", false);
$(this).removeAttr("checked");
}
})