let nav_html = `
`; $("#navbar-head").html(nav_html); 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: 969, }); } } $("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") } //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"; 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); $(".main-menu").find("nav ul").find("li a").each(function(){ 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); } }) }); $(".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); } }); }