; (function ($) { "use strict"; $(document).ready(function () { /**----------------------------- * navbar fix * ---------------------------*/ $(document).on('click', '.navbar-area .navbar-nav li.menu-item-has-children>a', function (e) { e.preventdefault(); }) /*------------------------------------- menu -------------------------------------*/ $('.menu').click (function(){ $(this).toggleclass('open'); }); // mobile menu if ($(window).width() < 992) { $(".in-mobile").clone().appendto(".sidebar-inner"); $(".in-mobile ul li.menu-item-has-children").append(''); $('').insertafter(""); $(".menu-item-has-children a").click(function(e) { // e.preventdefault(); $(this).siblings('.sub-menu').animate({ height: "toggle" }, 300); }); } var menutoggle = $('.menu-toggle'); var mainmenu = $('.navbar-nav'); menutoggle.on('click', function() { if (menutoggle.hasclass('is-active')) { mainmenu.removeclass('menu-open'); } else { mainmenu.addclass('menu-open'); } }); /* ------------------------------------------------------------- menu show form ------------------------------------------------------------- */ if ( $(window).width() > 991 ) { if ($('.cat-menu').length){ $(".cat-menu").on('click', function(){ $(".cat-menu-wrap .sidebar-categories").fadetoggle("sidebar-categories-show", "linear"); $('.cat-menu').toggleclass('open'); }); $('body').on('click', function(event) { if (!$(event.target).closest('.cat-menu').length && !$(event.target).closest('.cat-menu-wrap .sidebar-categories').length) { $(".cat-menu-wrap .sidebar-categories").fadeout("sidebar-categories-show"); } if (!$(event.target).closest('.cat-menu').length && !$(event.target).closest('.cat-menu-wrap .sidebar-categories').length) { $('.cat-menu').removeclass('open'); } }); } } /*---------------------- search popup -----------------------*/ var bodyovrelay = $('#body-overlay'); var searchpopup = $('#search-popup'); var sidebarmenu = $('#sidebar-menu'); $(document).on('click', '#body-overlay', function (e) { e.preventdefault(); bodyovrelay.removeclass('active'); searchpopup.removeclass('active'); sidebarmenu.removeclass('active'); }); $(document).on('click', '#search', function (e) { e.preventdefault(); searchpopup.addclass('active'); bodyovrelay.addclass('active'); }); /*------------------ back to top ------------------*/ $(document).on('click', '.back-to-top', function () { $("html,body").animate({ scrolltop: 0 }, 2000); }); }); $(window).on("scroll", function() { /*--------------------------------------- sticky menu activation && sticky icon bar -----------------------------------------*/ // var mainmenutop = $(".navbar-area"); // if ($(window).scrolltop() >= 1) { // mainmenutop.addclass('navbar-area-fixed'); // } // else { // mainmenutop.removeclass('navbar-area-fixed'); // } var scrolltop = $('.back-to-top'); if ($(window).scrolltop() > 1000) { scrolltop.fadein(1000); } else { scrolltop.fadeout(1000); } }); $(window).on('load', function () { /*----------------- preloader ------------------*/ var preloder = $("#preloader"); preloder.fadeout(0); /*----------------- back to top ------------------*/ var backtotop = $('.back-to-top') backtotop.fadeout(); /*--------------------- cancel preloader ----------------------*/ $(document).on('click', '.cancel-preloader a', function (e) { e.preventdefault(); $("#preloader").fadeout(2000); }); /*-------------------------- trending-product-slider ---------------------------*/ $('.trending-product-slider').owlcarousel({ loop:true, margin:20, nav:true, navtext: ['',''], dots:true, smartspeed: 1500, responsive:{ 0:{ items:1 }, 600:{ items:2 }, 1000:{ items:4 } } }); /*-------------------------- banner-slider ---------------------------*/ $('.banner-slider').owlcarousel({ loop:true, margin:10, nav:true, navtext: ['',''], dots:true, items:1, autoplay:false, smartspeed: 1500, autoplaytimeout:5000, animateout: 'fadeout', }) /*-------------------------- category-slider ---------------------------*/ $('.category-slider').owlcarousel({ loop:true, margin:20, nav:true, dots:false, smartspeed: 1500, responsive:{ 0:{ items:1 }, 600:{ items:2 }, 1000:{ items:3 } } }); /*-------------------------- category-slider ---------------------------*/ $('.recent-slider').owlcarousel({ loop:true, margin:20, nav:true, smartspeed: 1500, dots:false, responsive:{ 0:{ items:1 }, 600:{ items:2 }, 1000:{ items:4 } } }); /*--------------------------------------- thumbnail slider ---------------------------------------*/ var productdetailslider = $('.single-thumbnail-slider'); var pthumbanilslider = $('.product-thumbnail-carousel'); if (productdetailslider.length) { productdetailslider.slick({ slidestoshow: 1, slidestoscroll: 1, arrows: true, speed: 2500, asnavfor: '.product-thumbnail-carousel' }); } if (pthumbanilslider.length) { pthumbanilslider.slick({ slidestoshow: 5, slidestoscroll: 1, asnavfor: '.single-thumbnail-slider', dots: false, centermode: false, focusonselect: true, arrows:false, prevarrow: '