// Hide Header on on scroll down // var didScroll; // var lastScrollTop = 0; // var delta = 5; // var navbarHeight = $(".nav").outerHeight(); // $(window).scroll(function(event) { // didScroll = true; // }); // setInterval(function() { // if (didScroll) { // hasScrolled(); // didScroll = false; // } // }, 250); $(document).ready(function () { DarkMode.setDark(false); $(".zoom").mousemove(function (e) { zoom(e); }); function zoom(e) { var x, y; var zoomer = e.currentTarget; if (e.offsetX) { offsetX = e.offsetX; } else { offsetX = e.touches[0].pageX; } if (e.offsetY) { offsetY = e.offsetY; } else { offsetX = e.touches[0].pageX; } x = (offsetX / zoomer.offsetWidth) * 100; y = (offsetY / zoomer.offsetHeight) * 100; zoomer.style.backgroundPosition = x + "% " + y + "%"; } $(".selecter").selectpicker(); }); $(document).on("click", ".heartBtn", function () { $(this).toggleClass("heartBtnActive"); }); $(document).on("click", ".searchBtn", function () { $(".nav").addClass("overNav"); $(".serchBar").slideDown(); $(".subMenu").slideUp(); $("#cLogo").attr("class", "showInline"); $("#wLogo").attr("class", "hide"); }); $(document).on("click", ".closeSearchBtn", function () { $(".nav").removeClass("overNav"); $(".serchBar").slideUp(); $("#cLogo").attr("class", "hide"); $("#wLogo").attr("class", "showInline"); }); $(document).on("click", ".subBack", function () { $(".nav").removeClass("overNav"); $(".subMenu").slideUp(); $("#cLogo").attr("class", "hide"); $("#wLogo").attr("class", "showInline"); }); $(document).on("click", ".shopBtn", function () { $(".nav").addClass("overNav"); $(".subMenu").slideDown(); $(".serchBar").slideUp(); $("#cLogo").attr("class", "showInline"); $("#wLogo").attr("class", "hide"); }); $(document).on("click", ".addToBagPreviewBtn", function () { $("body").addClass("fixedHeight"); $(".cartPreview").fadeIn(); $(".sildePreviewWrap").animate({ right: "0" }); }); $(document).on("click", ".continueBtn", function () { $("body").removeClass("fixedHeight"); $(".cartPreview").fadeOut(); $(".sildePreviewWrap").animate({ right: "-40%" }); }); $(document).on("click", ".cartPreviewCloseBtn", function () { $("body").removeClass("fixedHeight"); $(".cartPreview").fadeOut(); $(".sildePreviewWrap").animate({ right: "-40%" }); }); $(document).on("click", ".plantProfileBtn", function () { $(".productDetailDesWrap").hide(); $(".productProfileWrap").fadeIn(); }); $(document).on("click", ".productProfileCloseBtn", function () { $(".productProfileWrap").hide(); $(".productDetailDesWrap").fadeIn(); }); $(document).on("click", ".continueToShipBtn", function () { $(".checkOutInfo").hide(); $(".checkOutPayment").fadeIn(); $("html, body").animate({ scrollTop: 0 }, "slow"); }); $(document).on("click", ".returnPaymentInfoBtn", function () { $(".checkOutPayment").hide(); $(".checkOutInfo").fadeIn(); }); $(document).on("click", ".orderDetailBtn", function () { $(".orderPreview").hide(); $(".orderDetail").fadeIn(); }); $(document).on("click", ".closeOrderDetail", function () { $(".orderDetail").hide(); $(".orderPreview").fadeIn(); }); $(document).on("click", ".addressEditBtn", function () { $(this) .parent() .parent() .parent() .find(".addressTextareaWrap input") .attr("readonly", false); // $(this).parent().parent().find( "addressTextarea" ).attr("readonly", true); $(this).removeClass("show"); $(this).addClass("hide"); $(this).parent().find(".addressSaveBtn").addClass("show"); }); $(document).on("click", ".addressSaveBtn", function () { $(this) .parent() .parent() .parent() .find(".addressTextareaWrap input") .attr("readonly", true); $(this).removeClass("show"); $(this).addClass("hide"); $(this).parent().find(".addressEditBtn").addClass("show"); }); $(document).on("click", ".accountMenu a", function () { $(".mobileAccountMenu").animate({ left: "-100%" }); $("body").removeClass("fixedHeight"); }); $(document).on("click", ".faqMenu a", function () { $(".mobilefaqMenu").animate({ left: "-100%" }); $("body").removeClass("fixedHeight"); }); $(document).on("click", ".mobileAccountMenuBack", function () { $(".mobileAccountMenu").animate({ left: "0" }); $("body").addClass("fixedHeight"); }); $(document).on("click", ".noteBarClose", function () { $(".noteBar").hide(); }); $(document).on("click", ".mobilefaqMenuBack", function () { $(".mobilefaqMenu").animate({ left: "0" }); $("body").addClass("fixedHeight"); }); $(document).on("click", ".addNewAddressBtn", function () { // var div = $('