(function ($) { "use strict"; var $main_window = $(window); /*==================================== preloader js ======================================*/ // Preloader $(window).on('load', function() { if ($('#preloader').length) { $('#preloader').delay(500).fadeOut('slow', function() { $(this).remove(); }); } }); // Home Slider $('.home-slider').owlCarousel({ loop: true, margin: 0, items: 1, nav: false, dots: true, autoplay: true, autoplayHoverPause: true, smartSpeed:2000 }); new WOW().init(); /*==================================== scroll to top js ======================================*/ $(window).on("scroll", function () { if ($(this).scrollTop() > 250) { $(".back-to-top").fadeIn(200); } else { $(".back-to-top").fadeOut(200); } }); $(".back-to-top").on("click", function () { $("html, body").animate({ scrollTop: 0 }, "slow" ); return false; }); /*==================================== sticky menu js ======================================*/ $main_window.on('scroll', function () { var scroll = $(window).scrollTop(); if (scroll >= 200) { $(".affix").addClass("sticky-menu"); } else { $(".affix").removeClass("sticky-menu"); } }); /*==================================== toggle search ======================================*/ $('.menu-search a').on("click", function () { $('.menu-search-form').toggleClass('s-active'); }); /*==================================== navigation mobile menu ======================================*/ function mainmenu() { $('.dropdown-menu a.dropdown-toggle').on('click', function (e) { if (!$(this).next().hasClass('show')) { $(this).parents('.dropdown-menu').first().find('.show').removeClass("show"); } var $subMenu = $(this).next(".dropdown-menu"); $subMenu.toggleClass('show'); return false; }); } mainmenu(); /*================================================ Start Testimonilas =================================================*/ $(function () { 'use strict'; $(".testimonials-content").owlCarousel({ dots:true, nav:false, loop: true, autoplay: true, responsiveClass:true, responsive:{ 0:{ items:1, }, 600:{ items:1, nav:false }, 800:{ items:2, }, 1500:{ items:3, nav:false } } }); }); })(jQuery);