$(document).ready(function () { let navbarHtml = `
`; $("#navbar-head").html(navbarHtml); let navhtml = `
`; $(".biz-nav-wrapper").after(navhtml); //$("#navbar-head").html(navbarHtml); $(".navbar-toggler").click(function () { $("#navbar-head").toggleClass("bg-white"); }) $('.pricing').find('.biz-nav-wrapper .navbar').addClass('bg-white'); // active-menu if (location.pathname != "/") { // Main Nav $(".navbar-nav li a").each(function () { if (this.href === location.href) { $(this).addClass("active"); if ($(this).parents().hasClass("nav-item")) { $(this).parents(".nav-item").find(".nav-link").addClass("active"); } return false; } }); } // Add Dropdown chevron icon let width = $(window).width(); if (width <= 991.98) { $(".dropdown .nav-link").attr("data-toggle", "dropdown"); $('.navbar-collapse.mega-nav ul').addClass('d-none') $('.navbar-collapse.mobile-menu ul').removeClass('d-none'); $(".biz-nav-wrapper").removeClass("d-none"); $(".ruby-menu-demo-header").addClass("d-none"); } else { $(".dropdown .nav-link").attr("data-toggle", ""); $('.navbar-collapse.mega-nav ul').removeClass('d-none') $('.navbar-collapse.mobile-menu ul').addClass('d-none') $('.navbar-expand-lg .navbar-collapse.mobile-menu').remove() } // Toggle Icon Change $(".biz-nav-wrapper .navbar-toggler").click(function () { $(this).find(".navbar-toggler-icon,.navbar-close-icon").toggle("slow"); $(".index-new").find(".navbar").toggleClass("bg-white"); }); $(".nav-item.dropdown.has-mega-menu").off().hover( function (e) { $("#navbar-head").find(".navbar").css("background-color", "#fff"); }, // over function (e) { $("#navbar-head").find(".navbar").css("background-color", ""); } // out ); $(document).scroll(function () { if ($(window).scrollTop() === 0) { $(".nav-item.dropdown.has-mega-menu").off().hover( function (e) { $("#navbar-head").find(".navbar").css("background-color", "#fff"); }, // over function (e) { $("#navbar-head").find(".navbar").css("background-color", ""); } // out ); } else { $(".nav-item.dropdown.has-mega-menu").off().hover( function (e) { $("#navbar-head").find(".navbar").css("background-color", "#fff"); }, // over function (e) { $("#navbar-head").find(".navbar").css("background-color", "#fff"); } // out ); } }); var scroll_start = 0; var startchange = $(".main-body"); var offset = startchange.offset(); $("#navbar-head") .find(".navbar").addClass("bg-white"); if (startchange.length) { $(document).scroll(function () { scroll_start = $(this).scrollTop(); if (scroll_start > offset.top) { $("#navbar-head") .find(".navbar") .css("background-color", "#fff") .css("box-shadow", "0px 12px 20px -25px"); } else { $("#navbar-head") .find(".navbar") // .css("background-color", "transparent") .css("box-shadow", "none"); $(".nav-item.dropdown.has-mega-menu").hover( function (e) { $("#navbar-head").find(".navbar").css("background-color", "#fff"); }, // over function (e) { $("#navbar-head").find(".navbar").css("background-color", ""); } // out ); } }); } else { $("#navbar-head") .find(".navbar") .css("background-color", "#fff") .css("box-shadow", "0px 12px 20px -25px"); } $('.owl-carousel.server-img-sec').owlCarousel({ // loop: true, margin: 10, rtl: false, nav: false, autoHeight: true, responsive: { 0: { items: 1 }, 600: { items: 3 }, 1000: { items: 4 } } }); $('.owl-carousel.accessories-img-sec').owlCarousel({ // loop: true, margin: 10, rtl: false, nav: false, autoHeight: true, responsive: { 0: { items: 1 }, 600: { items: 3 }, 1000: { items: 4 } } }); $(".ruby-menu").find(".nav_item").each(function () { $(this).click(function () { let item_id = $(this).attr("item_id"); let loc_path = '/products.html' if (window.location.pathname.includes(loc_path)) { window.location.href = `?products` } else { window.location.href = `/products.html?products`; } }) }); $("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}`; } }) // destroy localstorage data let loc_path = '/productdetails.html'; if (window.location.pathname.includes(loc_path) === false) { localStorage.removeItem("product_data") } });