(function ($) { "use strict"; new WOW().init(); /*---background image---*/ function dataBackgroundImage() { $('[data-bgimg]').each(function () { var bgImgUrl = $(this).data('bgimg'); $(this).css({ 'background-image': 'url(' + bgImgUrl + ')', // + meaning concat }); }); } $(window).on('load', function () { dataBackgroundImage(); }); /*---stickey menu---*/ $(window).on('scroll',function() { var scroll = $(window).scrollTop(); if (scroll < 100) { $(".sticky-header").removeClass("sticky"); }else{ $(".sticky-header").addClass("sticky"); } }); /*---slider activation---*/ $('.slider_carousel').owlCarousel({ animateOut: 'fadeOut', autoplay: true, loop: true, nav: false, autoplay: false, autoplayTimeout: 8000, items: 1, dots: true, }); /*---categories column7 activation---*/ $('.categories_column7').on('changed.owl.carousel initialized.owl.carousel', function (event) { $(event.target).find('.owl-item').removeClass('last').eq(event.item.index + event.page.size - 1).addClass('last')}).owlCarousel({ autoplay: true, loop: true, nav: false, autoplay: false, autoplayTimeout: 8000, items: 7, margin: 20, dots:false, responsiveClass:true, responsive:{ 0:{ items:1, }, 480:{ items:2, }, 576:{ items:3, }, 768:{ items:5, }, 992:{ items:5, }, 1200:{ items:6, }, 1300:{ items:7, }, } }); /*---product column6 activation---*/ $('.product_column6').on('changed.owl.carousel initialized.owl.carousel', function (event) { $(event.target).find('.owl-item').removeClass('last').eq(event.item.index + event.page.size - 1).addClass('last')}).owlCarousel({ autoplay: true, loop: true, nav: true, autoplay: false, autoplayTimeout: 8000, items: 6, margin: 20, dots:false, navText: ['',''], responsiveClass:true, responsive:{ 0:{ items:1, }, 480:{ items:2, }, 576:{ items:2, }, 768:{ items:3, }, 992:{ items:4, }, 1200:{ items:5, }, 1301:{ items:6, }, } }); /*---product column5 activation---*/ $('.product_column5').on('changed.owl.carousel initialized.owl.carousel', function (event) { $(event.target).find('.owl-item').removeClass('last').eq(event.item.index + event.page.size - 1).addClass('last')}).owlCarousel({ autoplay: true, loop: true, nav: false, autoplay: false, autoplayTimeout: 8000, items: 5, dots:false, responsiveClass:true, responsive:{ 0:{ items:1, }, 480:{ items:2, }, 768:{ items:3, }, 992:{ items:4, }, 1200:{ items:5, }, } }); function checkClasses(){ var total = $('.product_column5 .owl-stage .owl-item.active').length; $(".product_column5").each(function(){ $(this).find('.owl-item').removeClass('firstActiveItem'); $(this).find('.owl-item').removeClass('lastActiveItem'); $(this).find('.owl-item.active').each(function(index){ if (index === 0) { $(this).addClass('firstActiveItem'); } if (index === total - 1 && total > 1) { $(this).addClass('lastActiveItem'); } }); }); } checkClasses(); /*---product details column5 activation---*/ $('.product_details_column5').on('changed.owl.carousel initialized.owl.carousel', function (event) { $(event.target).find('.owl-item').removeClass('last').eq(event.item.index + event.page.size - 1).addClass('last')}).owlCarousel({ autoplay: true, loop: true, nav: true, autoplay: false, autoplayTimeout: 8000, items: 5, dots:false, navText: ['',''], responsiveClass:true, responsive:{ 0:{ items:1, }, 480:{ items:2, }, 768:{ items:3, }, 992:{ items:4, }, 1200:{ items:5, }, } }); /*---product column4 activation---*/ $('.product_column4').on('changed.owl.carousel initialized.owl.carousel', function (event) { $(event.target).find('.owl-item').removeClass('last').eq(event.item.index + event.page.size - 1).addClass('last')}).owlCarousel({ autoplay: true, loop: true, nav: true, autoplay: false, autoplayTimeout: 8000, items: 4, dots:false, navText: ['',''], responsiveClass:true, responsive:{ 0:{ items:1, }, 480:{ items:2, }, 768:{ items:3, }, 992:{ items:3, }, 1200:{ items:4, }, } }); /*---product column3 activation---*/ $('.product_column3').on('changed.owl.carousel initialized.owl.carousel', function (event) { $(event.target).find('.owl-item').removeClass('last').eq(event.item.index + event.page.size - 1).addClass('last')}).owlCarousel({ autoplay: true, loop: true, nav: true, autoplay: false, autoplayTimeout: 8000, items: 3, dots:false, navText: ['',''], responsiveClass:true, responsive:{ 0:{ items:1, }, 480:{ items:2, }, 768:{ items:3, }, 992:{ items:2, }, 1200:{ items:2, }, 1300:{ items:3, }, } }); /*---product column2 activation---*/ $('.product_column2').on('changed.owl.carousel initialized.owl.carousel', function (event) { $(event.target).find('.owl-item').removeClass('last').eq(event.item.index + event.page.size - 1).addClass('last')}).owlCarousel({ autoplay: true, loop: true, nav: true, autoplay: false, autoplayTimeout: 8000, items: 2, dots:false, navText: ['',''], responsiveClass:true, responsive:{ 0:{ items:1, }, 768:{ items:1, }, 992:{ items:2, }, } }); /*---product column2 activation---*/ $('.product_style_four').on('changed.owl.carousel initialized.owl.carousel', function (event) { $(event.target).find('.owl-item').removeClass('last').eq(event.item.index + event.page.size - 1).addClass('last')}).owlCarousel({ autoplay: true, loop: true, nav: true, autoplay: false, autoplayTimeout: 8000, items: 2, margin: 20, dots:false, navText: ['',''], responsiveClass:true, responsive:{ 0:{ items:1, }, 768:{ items:1, }, 1200:{ items:2, }, } }); /*---product column1 activation---*/ $('.product_column1').on('changed.owl.carousel initialized.owl.carousel', function (event) { $(event.target).find('.owl-item').removeClass('last').eq(event.item.index + event.page.size - 1).addClass('last')}).owlCarousel({ autoplay: true, loop: true, nav: true, autoplay: false, autoplayTimeout: 8000, items: 1, dots:false, navText: ['',''], responsiveClass:true, responsive:{ 0:{ items:1, }, 768:{ items:2, margin: 20, }, 992:{ items:1, }, } }); /*---deals product column1 activation---*/ $('.deals_product_column1').on('changed.owl.carousel initialized.owl.carousel', function (event) { $(event.target).find('.owl-item').removeClass('last').eq(event.item.index + event.page.size - 1).addClass('last')}).owlCarousel({ autoplay: true, loop: true, nav: true, autoplay: false, autoplayTimeout: 8000, items: 1, dots:false, navText: ['',''], responsiveClass:true, responsive:{ 0:{ items:1, }, 992:{ items:1, }, } }); /*---small product activation---*/ $('.small_product_active').slick({ centerMode: true, centerPadding: '0', slidesToShow: 1, arrows:true, rows: 4, prevArrow:'', nextArrow:'', responsive:[ { breakpoint: 480, settings: { slidesToShow: 1, slidesToScroll: 1, } }, { breakpoint: 1200, settings: { slidesToShow: 1, slidesToScroll: 1, rows: 3, } }, ] }); /*---testimonial active activation---*/ $('.testimonial-two').owlCarousel({ autoplay: true, loop: true, nav: false, autoplay: false, autoplayTimeout: 8000, items: 1, autoplayHoverPause: false, dots: true, }) var owl = $('.blog_column4'); var owlCarouselTimeout = 2000; /*---blog column3 activation---*/ $('.blog_column4').owlCarousel({ autoplay: true, loop: true, nav: true, autoplay: true, autoplayTimeout: 2000, autoplayHoverPause: true, autoplayTimeout: owlCarouselTimeout, items: 4, dots:false, navText: ['',''], responsiveClass:true, responsive:{ 0:{ items:1, }, 768:{ items:2, }, 992:{ items:3, }, 1200:{ items:4, }, } }); owl.on('mouseleave',function(){ owl.trigger('stop.owl.autoplay'); //this is main line to fix it owl.trigger('play.owl.autoplay', [owlCarouselTimeout]); }); /*---brand container activation---*/ $('.brand_container').on('changed.owl.carousel initialized.owl.carousel', function (event) { $(event.target).find('.owl-item').removeClass('last').eq(event.item.index + event.page.size - 1).addClass('last')}).owlCarousel({ autoplay: true, loop: true, nav: false, autoplay: false, autoplayTimeout: 8000, items: 6, dots:false, responsiveClass:true, responsive:{ 0:{ items:1, }, 320:{ items:2, }, 576:{ items:3, }, 768:{ items:4, }, 992:{ items:5, }, 1200:{ items:6, }, } }); function checkClasses(){ var total = $('.brand_container .owl-stage .owl-item.active').length; $(".brand_container").each(function(){ $(this).find('.owl-item').removeClass('firstActiveItem'); $(this).find('.owl-item').removeClass('lastActiveItem'); $(this).find('.owl-item.active').each(function(index){ if (index === 0) { $(this).addClass('firstActiveItem'); } if (index === total - 1 && total > 1) { $(this).addClass('lastActiveItem'); } }); }); } checkClasses(); /*---blog thumb activation---*/ $('.blog_thumb_active').owlCarousel({ autoplay: true, loop: true, nav: true, autoplay: false, autoplayTimeout: 8000, items: 1, navText: ['',''], }); /*---single product activation---*/ $('.single-product-active').owlCarousel({ autoplay: true, loop: true, nav: true, autoplay: false, autoplayTimeout: 8000, items: 4, margin:15, dots:false, navText: ['',''], responsiveClass:true, responsive:{ 0:{ items:1, }, 320:{ items:2, margin:10, }, 992:{ items:3, }, 1200:{ items:4, }, } }); /*---product navactive activation---*/ $('.product_navactive').owlCarousel({ autoplay: true, loop: true, nav: true, autoplay: false, autoplayTimeout: 8000, items: 4, dots:false, navText: ['',''], responsiveClass:true, responsive:{ 0:{ items:1, }, 250:{ items:2, }, 480:{ items:3, }, 768:{ items:4, }, } }); $('.modal').on('shown.bs.modal', function (e) { $('.product_navactive').resize(); }) $('.product_navactive a').on('click',function(e){ e.preventDefault(); var $href = $(this).attr('href'); $('.product_navactive a').removeClass('active'); $(this).addClass('active'); $('.product-details-large .tab-pane').removeClass('active show'); $('.product-details-large '+ $href ).addClass('active show'); }) /*--- video Popup---*/ $('.video_popup').magnificPopup({ type: 'iframe', removalDelay: 300, mainClass: 'mfp-fade' }); /*--- Magnific Popup Video---*/ $('.port_popup').magnificPopup({ type: 'image', gallery: { enabled: true } }); /*--- Tooltip Active---*/ $('.action_links ul li a,.add_to_cart a,.footer_social_link ul li a').tooltip({ animated: 'fade', placement: 'top', container: 'body' }); /*--- niceSelect---*/ $('.select_option').niceSelect(); /*--- Accordion---*/ $(".faequently-accordion").collapse({ accordion:true, open: function() { this.slideDown(300); }, close: function() { this.slideUp(300); } }); /*--- counterup activation ---*/ $('.counter_number').counterUp({ delay: 10, time: 1000 }); /*--- ScrollUp Active ---*/ $.scrollUp({ scrollText: '', easingType: 'linear', scrollSpeed: 900, animation: 'fade' }); /*---countdown activation---*/ $('[data-countdown]').each(function() { var $this = $(this), finalDate = $(this).data('countdown'); $this.countdown(finalDate, function(event) { $this.html(event.strftime('