/*! * @update 02.10.2020 * @author Webibazaar Template https://www.webibazaar.com * @contact info@webibazaar.com * @license * Copyright 2016-2020 Winter Infotech Team * Dual licensed under the MIT or GPL Version 2 licenses. * */ // Quantity Cart Start var qty = { 'minus' : function(product_id) { var input = $("input[id='input-quantity-" + product_id + "']"); var currentVal = parseInt(input.val()); if (!isNaN(currentVal)) { var minValue = parseInt(input.attr('min')); if (!minValue) minValue = 1; if (currentVal > minValue) { input.val(currentVal - 1).change(); } if (parseInt(input.val()) == minValue) { $(this).attr('disabled', true); } } else { input.val(1); } }, 'plus' : function(product_id) { var input = $("input[id='input-quantity-" + product_id + "']"); var currentVal = parseInt(input.val()); if (!isNaN(currentVal)) { var maxValue = parseInt(input.attr('max')); if (!maxValue) maxValue = 999; if (currentVal < maxValue) { input.val(currentVal + 1).change(); $('.dis-' + product_id).prop('disabled', false); } if (parseInt(input.val()) == maxValue) { $(this).attr('disabled', true); } } else { input.val(1); } }, 'cart' : function(product_id) { var qty = $('#input-quantity-' + product_id).val(); if(qty > 0) cart.add(product_id,qty); else { //alert($("input[name='hid-qty-msg']").val()); $('#content').parent().before('
' + $("input[name='hid-qty-msg']").val() + '
'); $('html, body').animate({ scrollTop: 0 }, 'slow'); $('#input-quantity-' + product_id).val("1"); } } } // Quantity Cart End /* responsive menu */ function openNav() { document.getElementById("myOverlay").style.display = "block"; document.getElementById("stamenu").className = "active menu-fixed"; } function closeNav() { document.getElementById("myOverlay").style.display = "none"; document.getElementById("stamenu").className = "menu-fixed"; } /* loader */ $(window).load(function myFunction() { $(".s-panel .loader").removeClass("wrloader"); }); //go to top $(document).ready(function () { $("#common-home").parent().addClass("home-page"); $(window).scroll(function () { if ($(this).scrollTop() > 100) { $('#scroll').fadeIn(); } else { $('#scroll').fadeOut(); } }); $('#scroll').click(function () { $("html, body").animate({scrollTop: 0}, 600); return false; }); }); $(document).ready(function () { if ($(window).width() <= 991) { $('.menusp').appendTo('.appmenu'); $('.curr').appendTo('.lhaccount'); $('.langg').appendTo('.lhaccount'); } $('.toprightw .owl-carousel.owl-theme .owl-buttons').appendTo('.apponbtn'); $('.leftpro').appendTo('.onsale_app'); $('.toppro').appendTo('.latest-app'); $('.catt-bg').appendTo('.timer'); }); function openSearch() { $('body').addClass("active-search"); document.getElementById("search").style.height = "auto"; $('#search').addClass("sideb"); // $('.search_query').attr('autofocus', 'autofocus').focus(); } function closeSearch() { $('body').removeClass("active-search"); document.getElementById("search").style.height = "0"; $('#search').addClass("siden"); // $('.search_query').attr('autofocus', 'autofocus').focus(); } $(document).ready(function () { $("#ratep,#ratecount").click(function() { $('body,html').animate({ scrollTop: $(".product-tab").offset().top }, 1500); }); }); /* dropdown effect of account */ $(document).ready(function () { if ($(window).width() <= 767) { $('.catfilter').appendTo('.appres'); $('.dropdown a.account').on("click", function(e) { $(this).next('ul').toggle(); e.stopPropagation(); e.preventDefault(); }); } }); $(document).ready(function () { $('.dropdown button.test').on("click", function(e) { $(this).next('ul').toggle(); e.stopPropagation(); e.preventDefault(); }); }); /* dropdown */ /* sticky header */ if ($(window).width() >= 992) { $(document).ready(function(){ $(window).scroll(function () { if ($(this).scrollTop() > 100) { $('.hsticky').addClass('fixed fadeInDown animated'); } else { $('.hsticky').removeClass('fixed fadeInDown animated'); } }); }); }; /* $(document).ready(function(){ if ($(window).width() >= 992) { var number_blocks =7; var count_block = $('#menu .m-menu'); var moremenu = count_block.slice(number_blocks, count_block.length); moremenu.wrapAll('