(function ($) { "use strict"; /*---------------------------- toogle search ------------------------------ */ // handle click on toggle search button $('.header-search').click(function() { $('.search').toggleclass('open'); return false; }); // handle click on search submit button $('#search-form input[type=submit]').click(function() { $('.search').toggleclass('open'); return true; }); // clicking outside the search form closes it $(document).click(function(event) { var target = $(event.target); if (!target.is('.header-search') && !target.closest('.search').size()) { $('.search').removeclass('open'); } }); /*---------------------------- sidebar toggle menu ------------------------------ */ $('.show-submenu').on('click', function() { $(this).parent().find('.submenu').toggleclass('submenu-active'); $(this).toggleclass('submenu-active'); return false; }); $('.show-submenu-dropdown').on('click', function() { $(this).parent().find('.submenu-dropdown').toggleclass('submenu-dropdown-active'); $(this).toggleclass('submenu-dropdown-active'); return false; }); /*---------------------------- jquery meanmenu ------------------------------ */ jquery('nav#dropdown').meanmenu(); /*---------------------------- wow js active ------------------------------ */ new wow().init(); /*---------------------------- client owl active ------------------------------ */ $(".client-owl").owlcarousel({ autoplay: false, slidespeed:2000, pagination:false, navigation:false, items : 6, /* transitionstyle : "fade", */ /* [this code for animation ] */ navigationtext:["prev","next"], itemsdesktop : [1199,5], itemsdesktopsmall : [980,4], itemstablet: [768,2], itemsmobile : [479,1], }); /*---------------------------- team owl active ------------------------------ */ $(".team-owl").owlcarousel({ autoplay: false, slidespeed:2000, pagination:false, navigation:false, items : 4, /* transitionstyle : "fade", */ /* [this code for animation ] */ navigationtext:["prev","next"], itemsdesktop : [1199,4], itemsdesktopsmall : [980,3], itemstablet: [768,2], itemsmobile : [479,1], }); /*---------------------------- testimonial owl active ------------------------------ */ $(".testimonial-owl").owlcarousel({ autoplay: false, slidespeed:2000, pagination:true, navigation:false, items : 1, /* transitionstyle : "fade", */ /* [this code for animation ] */ navigationtext:false, itemsdesktop : [1199,1], itemsdesktopsmall : [980,1], itemstablet: [768,1], itemsmobile : [479,1], }); /*---------------------------- testimonial owl active ------------------------------ */ $(".testimonial-owl-two").owlcarousel({ autoplay: false, slidespeed:2000, pagination:true, navigation:false, items : 1, navigationtext:false, itemsdesktop : [1199,1], itemsdesktopsmall : [980,1], itemstablet: [768,1], itemsmobile : [479,1], }); /*---------------------------- testimonial owl five active ------------------------------ */ $(".testimonial-owl-five").owlcarousel({ autoplay: false, slidespeed:2000, pagination:false, navigation:false, items : 1, /* transitionstyle : "fade", */ /* [this code for animation ] */ navigationtext:false, itemsdesktop : [1199,1], itemsdesktopsmall : [980,1], itemstablet: [768,1], itemsmobile : [479,1], }); /*---------------------------- blog five owl active ------------------------------ */ $(".blog-five-owl").owlcarousel({ autoplay: false, slidespeed:2000, pagination:false, navigation:false, items : 2, /* transitionstyle : "fade", */ /* [this code for animation ] */ navigationtext:false, itemsdesktop : [1199,2], itemsdesktopsmall : [980,2], itemstablet: [768,1], itemsmobile : [479,1], }); /*-------------------------- countdown ---------------------------- */ $('[data-countdown]').each(function() { var $this = $(this), finaldate = $(this).data('countdown'); $this.countdown(finaldate, function(event) { $this.html(event.strftime('
%-ddays
%-hhrs
%mmins
%ssecs
')); }); }); /*---------------------------- price-slider active ------------------------------ */ $( "#slider-range" ).slider({ range: true, min: -5, max: 310, values: [ 40, 250 ], slide: function( event, ui ) { $( "#amount" ).val( "$" + ui.values[ 0 ] + " - $" + ui.values[ 1 ] ); } }); $( "#amount" ).val( "$" + $( "#slider-range" ).slider( "values", 0 ) + " - $" + $( "#slider-range" ).slider( "values", 1 ) ); /*-------------------------- elevatezoom ---------------------------- */ $("#zoom1").elevatezoom({ gallery:'gallery_01', responsive : true, galleryactiveclass: "active", imagecrossfade: true, easing : true, cursor: "default", zoomwindowfadein: 300, zoomwindowfadeout: 350 }); /*-------------------------- scrollup ---------------------------- */ $.scrollup({ scrolltext: '', easingtype: 'linear', scrollspeed: 900, animation: 'fade' }); /*---------------------------------------------- personal address toggle function -----------------------------------------------*/ $("#add-new-address").on('click', function(){ $("#add-new-address-info").slidetoggle(); }); $("#transfer").on('click', function(){ $("#transfer-info").slidetoggle(); }); $("#payment").on('click', function(){ $("#payment-info").slidetoggle(); }); $("#paypal").on('click', function(){ $("#paypal-info").slidetoggle(); }); /*---------------------------- input plus minus button ------------------------------ */ $(".cart-plus-minus").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 = 0; } } $button.parent().find("input").val(newval); }); /*-------------------------- counter up ---------------------------- */ $('.counter').counterup({ delay: 70, time: 5000 }); /*-------------------------- mix it up ---------------------------- */ $('.filter-items').mixitup(); })(jquery);