navINIT(); function navINIT() { if(!window.location.href.includes('orderconfirmation')&&!window.location.href.includes('/w/')){ loadCart(); } function loadHelper(src = './dist/js/utils/helpers.js'){ if ($(`script[src="${src}"]`).length > 0) { return new Promise((resolve) => resolve()); } return new Promise(function (resolve, reject) { var s; s = document.createElement('script'); s.src = src; s.onload = resolve; s.onerror = reject; document.head.appendChild(s); }); } async function loadCart(){ if(!window.location.href.includes('services/paymentmethod.html')){ let files = ['./dist/js/shoppingcart/addtocart.js']; await loadHelper(); for(let i=0;i 0) { continue; } try { await loadHelper(files[i]) console.log("done"); } catch (error) { console.log(error); return; } } } setLengthCart(); //console.log("hello"); } let URLNAMENAV = window.location.href; const isTransparent = URLNAMENAV.includes('login')||URLNAMENAV.includes('orderconfirmation')|| URLNAMENAV.includes('services/paymentmethod.html'); let nav_html = `
`; $("#navbar-head").html(nav_html); $('.explandlinavname').click(function (e){ if($('.expandlinav .viewall_li').hasClass('d-none')){ $('.expandlinav').find('.viewall_li').removeClass('d-none'); $('.expandlinav').find('.content-expandlinav').removeClass('d-none'); }else{ $('.expandlinav').find('.viewall_li').addClass('d-none'); $('.expandlinav').find('.content-expandlinav').addClass('d-none'); } console.log($(e.target)); }); let width = $(window).width(); $(".menu-negative-mrg2,.menu-negative-mrg3,.menu-negative-mrg4").css("width", width); let ele_page = $("body").hasClass("product_pg"); if (ele_page == true) { $(".header-area").removeClass("bg-white"); $(".main-menu").find("nav ul li a").addClass("text-white"); $(".header-bottom.sticky-bar").removeClass("sticky-bar"); let src = `../dist/assets/imgs/anwi-logo-2.png`; $(".logo-menu-wrap").find("a img").attr("src", src); $(".main-body").find("iframe").attr("width", width); if (width <= 575 && width >= 390) { $(".main-body").find("iframe").attr({ width: width, height: 236, }) } else if (width <= 390 && width >= 270) { $(".main-body").find("iframe").attr({ width: width, height: 210, }); } else if (width <= 998 && width > 575) { $(".main-body").find("iframe").attr({ width: width, height: 530, }); } else if (width <= 2720 && width > 1920) { $(".main-body").find("iframe").attr({ width: width, height: 1440, }); } else { $(".main-body").find("iframe").attr({ width: width, height: 860, }); } } $("a.ram_data").click(function () { let item_id = $(this).attr("accessories_id"); let loc_path = '/products.html' if (window.location.pathname.includes(loc_path)) { window.location.href = `?itemid=${item_id}` } else { window.location.href = `/products.html#itemid=${item_id}`; } }) // $(".main-menu nav ul").find("li").each(function () { // var current = window.location.pathname; // var $this = $(this).find("a"); // if (current != "/") { // if ($this.attr('href').indexOf(current) !== -1) { // $(this).addClass('active_nav'); // } // } // }) // destroy localstorage data let loc_path = '/productdetails.html'; if (window.location.pathname.includes(loc_path) === false) { localStorage.removeItem("product_data"); localStorage.removeItem("top_data") } let loc_path1 = '/productcatloguedetails.html'; if (window.location.pathname.includes(loc_path1) === false) { localStorage.removeItem("product_catlogue_obj"); } //services pages links and sources let $body_pg = $("body").hasClass("services_page"); let $hm_pg = "../index.html"; let $nav_img = "../dist/assets/imgs/anwi-logo-1.png"; let $footer_img = "../dist/assets/imgs/anwi-logo-2.png"; let $scrool_top_img = "../dist/assets/imgs/Home/rocket-footer.png"; let $about_pg = $("body").hasClass("about_page"); if($about_pg == true){ debugger $(".main-menu").find("nav ul li a").addClass("text-dark"); let img_src = `./dist/assets/imgs/anwi-logo-1.png`; $(".logo-menu-wrap").find("a img").attr("src",img_src); $(".header-bottom").addClass("sticky-bar stick"); $("body.about_page").find(".header-large-device").find(".header-action-wrap").find(".same-style").find("svg").find("path").attr("fill","#000"); } if ($body_pg == true) { $(".header-large-device").find(".logo-menu-wrap .logo").find("a").attr("href", $hm_pg); $(".header-large-device").find(".logo-menu-wrap .logo").find("a img").attr("src", $nav_img); $(".mobile-logo").find("a").attr("href", $hm_pg); $(".mobile-logo").find("a img").attr("src", $nav_img); $("body.services_page").find(".header-large-device").find(".header-action-wrap").find(".same-style").find("svg").find("path").attr("fill","#000"); $(".main-menu").find("nav ul").find("li a").each(function () { $(this).addClass("text-dark") $(".header-bottom").addClass("sticky-bar stick"); let $arc = $(this).attr("href"); let $spcial_char = $arc.includes("./"); if ($spcial_char === true) { let $refarence = `.${$arc}` $(this).attr("href", $refarence); } }); $(".same-style").find("a").each(function () { let $arc1 = $(this).attr("href"); let $spcial_char1 = $arc1.includes("./"); if ($spcial_char1 === true) { let $refarence1 = `.${$arc1}` $(this).attr("href", $refarence1); } }) $(".tab-content").find("img").each(function(){ let $img_src = $(this).attr("src"); let $img_src1 = $img_src.includes("./"); if ($img_src1 === true) { let $refarenceimg1 = `.${$img_src}`; $(this).attr("src", $refarenceimg1); } }); $(".clickable-mainmenu-wrap").find("nav ul").find("li a").each(function () { let $arc_mbil = $(this).attr("href"); let $spcial_char_mbil = $arc_mbil.includes("./"); if ($spcial_char_mbil === true) { let $refarence_mbil = `.${$arc_mbil}` $(this).attr("href", $refarence_mbil); } }); } setTimeout(()=>{ if(width<=600){ $('.same-style').find('svg path').attr('fill','#000') } },300) }