(function ($) { "use strict"; /*------ ScrollUp -------- */ $.scrollUp({ scrollText: '', easingType: 'linear', scrollSpeed: 900, animation: 'fade' }); /*------ Wow Active ----*/ new WOW().init(); /*------ Hero slider active 1 ----*/ $('.hero-slider-active-1').slick({ slidesToShow: 1, slidesToScroll: 1, fade: true, loop: true, dots: true, arrows: true, prevArrow: '', nextArrow: '', }); /*------ Hero slider active 2 ----*/ $('.hero-slider-active-2').slick({ slidesToShow: 1, slidesToScroll: 1, autoplay: true, autoplaySpeed: 8000, pauseOnHover: false, fade: true, loop: true, dots: false, arrows: true, prevArrow: '', nextArrow: '', }); /*------ Hero slider active 3 ----*/ $('.hero-slider-active-3').slick({ slidesToShow: 1, slidesToScroll: 1, fade: true, loop: true, dots: true, arrows: false, }); /*------ Show/Hide options ----*/ $('#MasDeptos, #MasDeptos2').on('click', function(e) { // e.preventDefault(); $('.depto-options').toggleClass('hide-options'); $('#MasDeptos.btn-text .fa-angle-down, #MasDeptos2.btn-text .fa-angle-down').toggleClass('rotate'); }); $('#MasSubDeptos, #MasSubDeptos2').on('click', function(e) { // e.preventDefault(); $('.subdepto-options').toggleClass('hide-options'); $('#MasSubDeptos.btn-text .fa-angle-down, #MasSubDeptos2.btn-text .fa-angle-down').toggleClass('rotate'); }); $('#MasMarcas, #MasMarcas2').on('click', function(e) { // e.preventDefault(); $('.marca-options').toggleClass('hide-options'); $('#MasMarcas.btn-text .fa-angle-down, #MasMarcas2.btn-text .fa-angle-down').toggleClass('rotate'); }); /*------ Product slider active ----*/ $('.product-slider-active').slick({ slidesToShow: 4, slidesToScroll: 1, fade: false, loop: true, dots: true, arrows: false, responsive: [ { breakpoint: 1199, settings: { slidesToShow: 3, } }, { breakpoint: 991, settings: { slidesToShow: 2, } }, { breakpoint: 767, settings: { slidesToShow: 2, } }, { breakpoint: 575, settings: { slidesToShow: 1, } } ] }); /*------ Product slider active 2 ----*/ $('.product-slider-active-2').slick({ slidesToShow: 3, slidesToScroll: 1, fade: false, loop: true, dots: true, rows: 2, arrows: false, responsive: [ { breakpoint: 1199, settings: { slidesToShow: 2, } }, { breakpoint: 991, settings: { slidesToShow: 2, } }, { breakpoint: 767, settings: { slidesToShow: 1, } }, { breakpoint: 575, settings: { slidesToShow: 1, } } ] }); /*------ Product slider active 3 ----*/ $('.product-slider-active-3').slick({ slidesToShow: 5, slidesToScroll: 1, fade: false, loop: true, dots: false, arrows: true, prevArrow: '', nextArrow: '', responsive: [ { breakpoint: 1199, settings: { slidesToShow: 4, } }, { breakpoint: 991, settings: { slidesToShow: 3, } }, { breakpoint: 767, settings: { slidesToShow: 2, } }, { breakpoint: 575, settings: { slidesToShow: 2, } } ] }); /*------ Product slider active 4 ----*/ $('.product-slider-active-4').slick({ slidesToShow: 4.2, slidesToScroll: 1, fade: false, loop: false, dots: false, arrows: true, prevArrow: '', nextArrow: '', responsive: [ { breakpoint: 1199, settings: { slidesToShow: 4, } }, { breakpoint: 991, settings: { slidesToShow: 3, } }, { breakpoint: 767, settings: { slidesToShow: 2.3, } }, { breakpoint: 575, settings: { slidesToShow: 1.5, } } ] }); /*------ Product slider active 5 ----*/ $('.product-slider-active-5').slick({ slidesToShow: 4, slidesToScroll: 1, fade: false, loop: true, dots: false, arrows: false, responsive: [ { breakpoint: 1199, settings: { slidesToShow: 3, } }, { breakpoint: 991, settings: { slidesToShow: 3, } }, { breakpoint: 767, settings: { slidesToShow: 2, } }, { breakpoint: 575, settings: { slidesToShow: 1, } } ] }); /*------ product categories slider 1 ----*/ $('.product-categories-slider-1').slick({ slidesToShow: 6, slidesToScroll: 1, fade: false, loop: true, dots: false, arrows: true, prevArrow: '', nextArrow: '', responsive: [ { breakpoint: 1199, settings: { slidesToShow: 4, } }, { breakpoint: 991, settings: { slidesToShow: 3, } }, { breakpoint: 767, settings: { slidesToShow: 3, } }, { breakpoint: 575, settings: { slidesToShow: 2, } } ] }); /*------ Product categories slider 3 ----*/ $('.product-categories-slider-3').slick({ slidesToShow: 6, slidesToScroll: 1, fade: false, loop: true, dots: false, arrows: true, rows: 2, prevArrow: '', nextArrow: '', responsive: [ { breakpoint: 1199, settings: { slidesToShow: 4, } }, { breakpoint: 991, settings: { slidesToShow: 3, } }, { breakpoint: 767, settings: { slidesToShow: 3, } }, { breakpoint: 575, settings: { slidesToShow: 2, } } ] }); /*-------------------------------- InstagramFeed active -----------------------------------*/ // $(window).on('load', function(){ // var instagramFeedSliderOne = function () { // $.instagramFeed({ // username: "ecommerce.devitems", // container: "#instagramFeedOne", // display_profile: false, // 'display_biography': false, // display_gallery: true, // callback: null, // styling: false, // items: 8, // }); // }; // instagramFeedSliderOne(); // $("#instagramFeedOne").on("DOMNodeInserted", function (e) { // if (e.target.className === "instagram_gallery") { // $(".instagram-carousel .instagram_gallery").slick({ // slidesToShow: 5, // slidesToScroll: 1, // autoplay: false, // dots: false, // arrows: false, // loop: true, // responsive: [ // { // breakpoint: 767, // settings: { // slidesToShow: 3, // } // }, // { // breakpoint: 575, // settings: { // slidesToShow: 2, // } // } // ] // }); // $(".instagram-carousel-2 .instagram_gallery").slick({ // slidesToShow: 8, // slidesToScroll: 1, // autoplay: false, // dots: false, // arrows: false, // loop: true, // responsive: [ // { // breakpoint: 1199, // settings: { // slidesToShow: 6, // } // }, // { // breakpoint: 991, // settings: { // slidesToShow: 5, // } // }, // { // breakpoint: 767, // settings: { // slidesToShow: 3, // } // }, // { // breakpoint: 575, // settings: { // slidesToShow: 2, // } // } // ] // }); // } // }); // }); /*--- Language currency active ----*/ $('.language-dropdown-active').on('click', function(e) { e.preventDefault(); $('.language-dropdown').slideToggle(400); }); $('.currency-dropdown-active').on('click', function(e) { e.preventDefault(); $('.currency-dropdown').slideToggle(400); }); /*--- Countdown timer active ----*/ $('#timer-1-active , #timer-3-active').syotimer({ year: 2020, month: 10, day: 22, hour: 8, minute: 48, layout: 'hms', periodic: false, periodUnit: 'm' }); $('#timer-2-active').syotimer({ year: 2020, month: 10, day: 22, hour: 8, minute: 48, layout: 'dhms', periodic: false, periodUnit: 'm' }); /*====== SidebarCart ======*/ function miniCart() { var navbarTrigger = $('.cart-active'), endTrigger = $('.cart-close'), container = $('.sidebar-cart-active'), wrapper = $('.main-wrapper'); wrapper.prepend('
'); navbarTrigger.on('click', function(e) { e.preventDefault(); container.addClass('inside'); wrapper.addClass('overlay-active'); }); endTrigger.on('click', function() { container.removeClass('inside'); wrapper.removeClass('overlay-active'); }); $('.body-overlay').on('click', function() { container.removeClass('inside'); wrapper.removeClass('overlay-active'); }); }; miniCart(); /*------------------------------- Header Search Toggle -----------------------------------*/ var searchToggle = $('.search-toggle'); searchToggle.on('click', function(e){ e.preventDefault(); if($(this).hasClass('open')){ $(this).removeClass('open'); $(this).siblings('.search-wrap-1').removeClass('open'); }else{ $(this).addClass('open'); $(this).siblings('.search-wrap-1').addClass('open'); } }) $(document).on("click",".cerrar",function(){ $(".lista-resultados").slideToggle(900); $(".cerrar").attr("class","") }) $(".search-wrap-3").click(function(){ $(".lista-resultados").slideToggle(900); setTimeout(function () { $("body").addClass("cerrar"); }, 10); }) /* NiceSelect */ $('.nice-select').niceSelect(); /*------------------------- Category active --------------------------*/ $(document).ready(function(){ $('.categori-show').click(function(event){ event.stopPropagation(); $(".category-menu-2").slideToggle(500); }); $(".categori-show").on("click", function (event) { event.stopPropagation(); }); }); $(document).on("click", function () { $(".category-menu-2").fadeOut(50); }); /*-------------------------------- Deal slider active -----------------------------------*/ $('.deal-slider-active').slick({ slidesToShow: 1, slidesToScroll: 1, fade: false, loop: true, dots: false, arrows: true, prevArrow: '', nextArrow: '', }); /*-------------------------------- Sidebar product active -----------------------------------*/ $('.sidebar-product-active').slick({ slidesToShow: 1, slidesToScroll: 1, fade: false, loop: true, dots: false, rows: 3, arrows: true, prevArrow: '', nextArrow: '', }); /*-------------------------------- Sidebar blog active -----------------------------------*/ $('.sidebar-blog-active').slick({ slidesToShow: 1, slidesToScroll: 1, fade: false, loop: true, dots: false, rows: 2, arrows: true, prevArrow: '', nextArrow: '', }); /*-------------------------------- Product categories slider -----------------------------------*/ $('.product-categories-slider-2').slick({ slidesToShow: 5, slidesToScroll: 1, fade: false, loop: true, dots: false, arrows: true, prevArrow: '', nextArrow: '', responsive: [ { breakpoint: 1199, settings: { slidesToShow: 4, } }, { breakpoint: 991, settings: { slidesToShow: 3, } }, { breakpoint: 767, settings: { slidesToShow: 3, } }, { breakpoint: 575, settings: { slidesToShow: 2, } } ] }); /*-------------------------------- Testimonial active -----------------------------------*/ $('.testimonial-active-1').slick({ slidesToShow: 1, slidesToScroll: 1, fade: false, loop: true, dots: true, arrows: false, }); /*-------------------------------- Testimonial active 2 -----------------------------------*/ $('.testimonial-active-2').slick({ slidesToShow: 1, slidesToScroll: 1, fade: false, loop: true, dots: false, arrows: false, }); /*-------------------------------- Product slider active 6 -----------------------------------*/ $('.product-slider-active-6').slick({ slidesToShow: 2, slidesToScroll: 1, fade: false, loop: true, dots: true, rows: 2, arrows: false, responsive: [ { breakpoint: 1199, settings: { slidesToShow: 2, } }, { breakpoint: 991, settings: { slidesToShow: 2, } }, { breakpoint: 767, settings: { slidesToShow: 1, } }, { breakpoint: 575, settings: { slidesToShow: 1, } } ] }); /*-------------------------------- Product slider active 7 -----------------------------------*/ $('.product-slider-active-7').slick({ slidesToShow: 4, slidesToScroll: 1, fade: false, loop: true, dots: true, rows: 2, arrows: false, responsive: [ { breakpoint: 1199, settings: { slidesToShow: 3, } }, { breakpoint: 991, settings: { slidesToShow: 3, } }, { breakpoint: 767, settings: { slidesToShow: 2, } }, { breakpoint: 575, settings: { slidesToShow: 1, } } ] }); /*-------------------------------- Product slider active 8 -----------------------------------*/ $('.product-slider-active-8').slick({ slidesToShow: 5, slidesToScroll: 1, fade: false, loop: true, dots: true, arrows: true, prevArrow: '', nextArrow: '', responsive: [ { breakpoint: 1199, settings: { slidesToShow: 4, } }, { breakpoint: 991, settings: { slidesToShow: 3, } }, { breakpoint: 767, settings: { slidesToShow: 2, } }, { breakpoint: 575, settings: { slidesToShow: 1, } } ] }); /*-------------------------------- Product slider active 9 -----------------------------------*/ $('.product-slider-active-9').slick({ slidesToShow: 3, slidesToScroll: 1, fade: false, loop: true, dots: true, arrows: false, responsive: [ { breakpoint: 1199, settings: { slidesToShow: 3, } }, { breakpoint: 991, settings: { slidesToShow: 2, } }, { breakpoint: 767, settings: { slidesToShow: 2, } }, { breakpoint: 575, settings: { slidesToShow: 2, } } ] }); /*------- Color active -----*/ $('.pro-details-color-content').on('click', 'a', function(e){ e.preventDefault(); $(this).addClass('active').parent().siblings().children('a').removeClass('active'); }); /*-------------------------------- Social icon active -----------------------------------*/ if ($('.pro-details-action').length) { var $body = $('body'), $cartWrap = $('.pro-details-action'), $cartContent = $cartWrap.find('.product-dec-social'); $cartWrap.on('click', '.social', function(e) { e.preventDefault(); var $this = $(this); if (!$this.parent().hasClass('show')) { $this.siblings('.product-dec-social').addClass('show').parent().addClass('show'); } else { $this.siblings('.product-dec-social').removeClass('show').parent().removeClass('show'); } }); /*Close When Click Outside*/ $body.on('click', function(e) { var $target = e.target; if (!$($target).is('.pro-details-action') && !$($target).parents().is('.pro-details-action') && $cartWrap.hasClass('show')) { $cartWrap.removeClass('show'); $cartContent.removeClass('show'); } }); } /*--------------------- Price range --------------------- */ var sliderrange = $('#slider-range'); var amountprice = $('#amount'); $(function() { sliderrange.slider({ range: true, min: 16, max: 400, values: [0, 300], slide: function(event, ui) { amountprice.val("$" + ui.values[0] + " - $" + ui.values[1]); } }); amountprice.val("$" + sliderrange.slider("values", 0) + " - $" + sliderrange.slider("values", 1)); }); /*---------------------------- Cart Plus Minus Button ------------------------------ */ var CartPlusMinus = $('.cart-plus-minus'); CartPlusMinus.prepend('
-
'); CartPlusMinus.append('
+
'); $(".qtybutton").on("click", function() { var $button = $(this); var oldValue = $button.parent().find("input").val(); if ($button.text() === "+") { var newVal = parseFloat(oldValue) + 1; } else { // Don't allow decrementing below zero if (oldValue > 0) { var newVal = parseFloat(oldValue) - 1; } else { newVal = 1; } } $button.parent().find("input").val(newVal); }); $('#exampleModal').on('shown.bs.modal', function () { $('.quickview-slide-active').slick({ slidesToShow: 3, slidesToScroll: 1, fade: false, loop: true, dots: false, arrows: true, prevArrow: '', nextArrow: '', responsive: [ { breakpoint: 1199, settings: { slidesToShow: 3, } }, { breakpoint: 991, settings: { slidesToShow: 3, } }, { breakpoint: 767, settings: { slidesToShow: 3, } }, { breakpoint: 575, settings: { slidesToShow: 2, } } ] }); $('.quickview-slide-active a').on('click', function() { $('.quickview-slide-active a').removeClass('active'); }) }) /*====== Sidebar menu Active ======*/ function mobileHeaderActive() { var navbarTrigger = $('.mobile-header-button-active'), endTrigger = $('.sidebar-close'), container = $('.mobile-header-active'), wrapper4 = $('.main-wrapper'); wrapper4.prepend('
'); navbarTrigger.on('click', function(e) { e.preventDefault(); container.addClass('sidebar-visible'); wrapper4.addClass('overlay-active-1'); }); endTrigger.on('click', function() { container.removeClass('sidebar-visible'); wrapper4.removeClass('overlay-active-1'); }); $('.body-overlay-1').on('click', function() { container.removeClass('sidebar-visible'); wrapper4.removeClass('overlay-active-1'); }); }; mobileHeaderActive(); function mobileSidebar() { var sidebarTrigger = $('.btn-mobile-sidebar'), endTriggerSidebar = $('.sidebar-close'), containerSidebar = $('.mobile-sidebar'), wrapper4Sidebar = $('.main-wrapper'); wrapper4Sidebar.prepend('
'); sidebarTrigger.on('click', function(e) { e.preventDefault(); containerSidebar.addClass('sidebar-visible'); wrapper4Sidebar.addClass('overlay-active-1'); }); endTriggerSidebar.on('click', function() { containerSidebar.removeClass('sidebar-visible'); wrapper4Sidebar.removeClass('overlay-active-1'); }); $('.body-overlay-1').on('click', function() { containerSidebar.removeClass('sidebar-visible'); wrapper4Sidebar.removeClass('overlay-active-1'); }); }; mobileSidebar(); /*--------------------- mobile-menu --------------------- */ var $offCanvasNav = $('.mobile-menu , .category-menu-dropdown'), $offCanvasNavSubMenu = $offCanvasNav.find('.dropdown'); /*Add Toggle Button With Off Canvas Sub Menu*/ $offCanvasNavSubMenu.parent().prepend(''); /*Close Off Canvas Sub Menu*/ $offCanvasNavSubMenu.slideUp(); /*Category Sub Menu Toggle*/ $offCanvasNav.on('click', 'li a, li .menu-expand', function(e) { var $this = $(this); if ( ($this.parent().attr('class').match(/\b(menu-item-has-children|has-children|has-sub-menu)\b/)) && ($this.attr('href') === '#' || $this.hasClass('menu-expand')) ) { e.preventDefault(); if ($this.siblings('ul:visible').length){ $this.parent('li').removeClass('active'); $this.siblings('ul').slideUp(); } else { $this.parent('li').addClass('active'); $this.closest('li').siblings('li').removeClass('active').find('li').removeClass('active'); $this.closest('li').siblings('li').find('ul:visible').slideUp(); $this.siblings('ul').slideDown(); } } }); /*--- checkout toggle function ----*/ $('.checkout-click1').on('click', function(e) { e.preventDefault(); $('.checkout-login-info').slideToggle(900); }); /*--- checkout toggle function ----*/ $('.checkout-click3').on('click', function(e) { e.preventDefault(); $('.checkout-login-info3').slideToggle(1000); }); /*------------------------- Create an account toggle --------------------------*/ $('.checkout-toggle2').on('click', function() { $('.open-toggle2').slideToggle(1000); }); $('.checkout-toggle').on('click', function() { $('.open-toggle').slideToggle(1000); }); /*------------------------- checkout one click toggle function --------------------------*/ var checked = $( '.sin-payment input:checked' ) if(checked){ $(checked).siblings( '.payment-box' ).slideDown(900); }; $( '.sin-payment input' ).on('change', function() { $( '.payment-box' ).slideUp(900); $(this).siblings( '.payment-box' ).slideToggle(900); }); // Instantiate EasyZoom instances var $easyzoom = $('.easyzoom').easyZoom(); if ($(window).width() < 760) { $easyzoom.each(function(i) { $easyzoom.eq(i).data("easyZoom").teardown(); }); } /*------------------------------------- Product details big image slider ---------------------------------------*/ $('.pro-dec-big-img-slider').slick({ slidesToShow: 1, slidesToScroll: 1, arrows: false, draggable: false, fade: false, asNavFor: '.product-dec-slider-small , .product-dec-slider-small-2', }); /*--------------------------------------- Product details small image slider -----------------------------------------*/ $('.product-dec-slider-small').slick({ slidesToShow: 4, slidesToScroll: 1, asNavFor: '.pro-dec-big-img-slider', dots: false, focusOnSelect: true, fade: false, prevArrow: '', nextArrow: '', responsive: [{ breakpoint: 991, settings: { slidesToShow: 3, } }, { breakpoint: 767, settings: { slidesToShow: 4, } }, { breakpoint: 575, settings: { slidesToShow: 2, } } ] }); /*---------------------------------------- Product details small image slider 2 ------------------------------------------*/ $('.product-dec-slider-small-2').slick({ slidesToShow: 4, slidesToScroll: 1, vertical: true, asNavFor: '.pro-dec-big-img-slider', dots: false, focusOnSelect: true, fade: false, prevArrow: '', nextArrow: '', responsive: [{ breakpoint: 1365, settings: { slidesToShow: 4, } }, { breakpoint: 1199, settings: { slidesToShow: 3, } }, { breakpoint: 991, settings: { slidesToShow: 4, } }, { breakpoint: 767, settings: { slidesToShow: 4, } }, { breakpoint: 575, settings: { slidesToShow: 2, } } ] }); /* Blog Carousel */ $('.blog-slide').slick({ slidesToShow: 1, slidesToScroll: 1, vertical: false, dots: true, autoplay:true, autoplaySpeed:3000, arrows:false, focusOnSelect: true, fade: false, }); /*-- Magnific Popup ------------------------*/ $('.img-popup').magnificPopup({ type: 'image', gallery: { enabled: true } }); $('.related-product-active').slick({ slidesToShow: 4, slidesToScroll: 1, fade: false, loop: true, dots: false, arrows: false, responsive: [ { breakpoint: 1199, settings: { slidesToShow: 3, } }, { breakpoint: 991, settings: { slidesToShow: 2, } }, { breakpoint: 767, settings: { slidesToShow: 2, } }, { breakpoint: 575, settings: { slidesToShow: 1.2, centerMode: true, swipeToSlide: true, } } ] }); /*------------------------ Sidebar sticky active -------------------------- */ $('.sidebar-active').stickySidebar({ topSpacing: 30, bottomSpacing: 30, // minWidth: 767, }); $('.sucursales-list').stickySidebar({ topSpacing: 0, bottomSpacing: 30, minWidth: 767, }); /*--- language currency active ----*/ $('.mobile-language-active').on('click', function(e) { e.preventDefault(); $('.lang-dropdown-active').slideToggle(900); }); $('.mobile-currency-active').on('click', function(e) { e.preventDefault(); $('.curr-dropdown-active').slideToggle(900); }); $('.brands').slick({ slidesToShow: 6, slidesToScroll: 3, fade: false, loop: true, dots: false, arrows: false, autoplay: true, responsive: [ { breakpoint: 1199, settings: { slidesToShow: 3, } }, { breakpoint: 991, settings: { slidesToShow: 3, } }, { breakpoint: 767, settings: { slidesToShow: 3, } }, { breakpoint: 575, settings: { slidesToShow: 3, } } ] }); /*--- VIEWPORT HEIGHT ---*/ // First we get the viewport height and we multiple it by 1% to get a value for a vh unit let vh = window.innerHeight * 0.01; // Then we set the value in the --vh custom property to the root of the document document.documentElement.style.setProperty('--vh', `${vh}px`); })(jQuery);