/*-------------------------------------------------- template name: elomous; description: ecommerce bootstrap 4 template; version: 1.0; note: main.js, all custom script and plugin activation script in this file. ----------------------------------------------------- js index ================================================ 1. newsletter popup 2. mobile menu activation 3. tooltip activation 4. cart box dropdown menu 5. checkout page activation 6. slider activation 7. our product activation 8. blog activation 9. testmonial activation 10. testmonial two for home version two 11. testmonial activation 12. thumbnail product activation 13. recent post activation 14. featured product activation 15. countdown js activation 16. scrollup activation 17. sticky-menu activation 18. nice select activation 19. price slider activation 20. brand logo activation ================================================*/ (function ($) { "use strict"; /*--------------------------- 1. newsletter popup ----------------------------*/ settimeout(function () { $('.popup_wrapper').css({ "opacity": "1", "visibility": "visible" }); $('.popup_off').on('click', function () { $(".popup_wrapper").fadeout(500); }) }, 2500); /*---------------------------- 2. mobile menu activation -----------------------------*/ jquery('.mobile-menu nav').meanmenu({ meanscreenwidth: "991", }); /*---------------------------- 3. tooltip activation ------------------------------ */ $('.pro-add-cart a,.pro-actions-link a').tooltip({ animated: 'fade', placement: 'top', container: 'body' }); /*--------------------------------- 4. cart box dropdown menu -----------------------------------*/ $('.drodown-show > a').on('click', function (e) { e.preventdefault(); if ($(this).hasclass('active')) { $('.drodown-show > a').removeclass('active').siblings('.dropdown').slideup() $(this).removeclass('active').siblings('.dropdown').slideup(); } else { $('.drodown-show > a').removeclass('active').siblings('.dropdown').slideup() $(this).addclass('active').siblings('.dropdown').slidedown(); } }); /*---------------------------- 5. checkout page activation -----------------------------*/ $('#showlogin').on('click', function () { $('#checkout-login').slidetoggle(); }); $('#showcoupon').on('click', function () { $('#checkout_coupon').slidetoggle(); }); $('#cbox').on('click', function () { $('#cbox_info').slidetoggle(); }); $('#ship-box').on('click', function () { $('#ship-box-info').slidetoggle(); }); /*---------------------------- 6. slider activation -----------------------------*/ $(".slider-activation").owlcarousel({ loop: true, margin: 0, nav: true, autoplay: false, animateout: 'fadeout', animatein: 'fadein', items: 1, autoplaytimeout: 10000, navtext: ["", ""], dots: true, autoheight: true, lazyload: true, }); /*---------------------------------- 7. our product activation -----------------------------------*/ $('.dron-product-active').owlcarousel({ loop: true, nav: true, dots: false, smartspeed: 1500, navtext: ["", ""], margin: 15, responsive: { 0: { items: 1, autoplay: true, smartspeed: 500 }, 500: { items: 2 }, 768: { items: 3 }, 992: { items: 3 }, 1200: { items: 4 }, 1500: { items: 6 } } }) /*------------------------------- 8. blog activation ---------------------------------*/ $('.blog-activation').owlcarousel({ loop: true, nav: true, dots: false, navtext: ["", ""], smartspeed: 700, margin: 30, responsive: { 0: { items: 1, autoplay: true, smartspeed: 500 }, 768: { items: 2 }, 992: { items: 3 }, 1200: { items: 3 } } }) /*------------------------------------- 9. testmonial activation -------------------------------------*/ $('.testmonial-active').owlcarousel({ loop: true, nav: false, dots: true, smartspeed: 1000, margin: 10, responsive: { 0: { items: 1, autoplay: true, smartspeed: 300 }, 768: { items: 2 }, 992: { items: 2 }, 1200: { items: 3 } } }) /*--------------------------------------------- 10. testmonial two for home version two -----------------------------------------------*/ $(".testmonial-active-two").owlcarousel({ autoplay: false, loop: false, margin: 30, navspeed: 1000, dotsspeed: 1000, autoplayspeed: 1000, nav: false, dots: true, lazyload: true, responsive: { 0: { items: 1 }, 576: { items: 2 }, 768: { items: 2 }, 992: { items: 3 }, 1200: { items: 4 }, 1600: { items: 3 } }, oninitialized: function () { // var count = $(".testmonial-active-two .owl-item.active").length; // if (count == 1) { // $(".testmonial-active-two .owl-item").removeclass('first'); // $(".testmonial-active-two .owl-item").removeclass('last'); // $(".testmonial-active-two .owl-item.active").addclass('first'); // } else { // $(".testmonial-active-two .owl-item").removeclass('first'); // $(".testmonial-active-two .owl-item").removeclass('last'); // $(".testmonial-active-two .owl-item.active:first").addclass('first'); // $(".testmonial-active-two .owl-item.active:last").addclass('last'); // } }, ontranslated: function () { // var count = $(".testmonial-active-two .owl-item.active").length; // if (count == 1) { // $(".testmonial-active-two .owl-item").removeclass('first'); // $(".testmonial-active-two .owl-item").removeclass('last'); // $(".testmonial-active-two .owl-item.active").addclass('first'); // } else { // $(".testmonial-active-two .owl-item").removeclass('first'); // $(".testmonial-active-two .owl-item").removeclass('last'); // $(".testmonial-active-two .owl-item.active:first").addclass('first'); // $(".testmonial-active-two .owl-item.active:last").addclass('last'); // } } }); /*------------------------------------ 11. testmonial activation ------------------------------------*/ $('.testmonial-active-three').owlcarousel({ loop: true, nav: false, dots: true, smartspeed: 1000, margin: 10, responsive: { 0: { items: 1, autoplay: true, smartspeed: 300 }, 768: { items: 1 }, 992: { items: 1 }, 1200: { items: 1 } } }) /*------------------------------------- 12. thumbnail product activation --------------------------------------*/ $('.thumb-menu').owlcarousel({ loop: true, navtext: ["", ""], margin: 15, smartspeed: 500, nav: true, dots: false, responsive: { 0: { items: 3, autoplay: true, }, 768: { items: 3 }, 1200: { items: 4 } } }) $('.thumb-menu a').on('click', function () { $('.thumb-menu a').removeclass('active'); }) /*----------------------------- 13. recent post activation -----------------------------*/ $(".recent-post-active").owlcarousel({ loop: true, margin: 0, smartspeed: 500, nav: false, autoplay: false, items: 1, dots: false, }); /*---------------------------------------- 14. featured product activation ----------------------------------------*/ $('.feature-pro-active').owlcarousel({ loop: false, nav: true, dots: false, smartspeed: 1500, navtext: ["", ""], margin: 5, responsive: { 0: { items: 2, autoplay: true, smartspeed: 500 }, 480: { items: 2 }, 768: { items: 2 }, 992: { items: 3 }, 1200: { items: 4 } } }) /*---------------------------- 15. countdown js activation -----------------------------*/ $('[data-countdown]').each(function () { var $this = $(this), finaldate = $(this).data('countdown'); $this.countdown(finaldate, function (event) { $this.html(event.strftime('

%d

days

%h

hours

%m

mins

%s

secs
')); }); }); /*---------------------------- 16. scrollup activation -----------------------------*/ $.scrollup({ scrollname: 'scrollup', // element id topdistance: '550', // distance from top before showing element (px) topspeed: 1000, // speed back to top (ms) animation: 'fade', // fade, slide, none scrollspeed: 900, animationinspeed: 1000, // animation in speed (ms) animationoutspeed: 1000, // animation out speed (ms) scrolltext: '', // text for element activeoverlay: false // set css color to display scrollup active point, e.g '#00ffff' }); /*---------------------------- 17. sticky-menu activation ------------------------------ */ $(window).on('scroll', function () { if ($(this).scrolltop() > 100) { $('.header-sticky').addclass("sticky"); } else { $('.header-sticky').removeclass("sticky"); } }); /*---------------------------- 18. nice select activation ------------------------------ */ $('select').niceselect(); /*---------------------------- 19. price slider activation -----------------------------*/ $("#slider-range").slider({ range: true, min: 0, max: 100, values: [0, 85], slide: function (event, ui) { $("#amount").val("$" + ui.values[0] + " $" + ui.values[1]); } }); $("#amount").val("$" + $("#slider-range").slider("values", 0) + " $" + $("#slider-range").slider("values", 1)); /*-------------------------------- 20. brand logo activation ---------------------------------*/ $('.brand-logo-active').owlcarousel({ loop: true, nav: true, dots: false, smartspeed: 500, navtext: ["", ""], margin: 20, responsive: { 0: { items: 1, autoplay: true, smartspeed: 300 }, 340: { items: 2 }, 480: { items: 3 }, 768: { items: 4 }, 992: { items: 4 }, 1200: { items: 4 } } }); })(jquery);