(function($) { 'use strict'; // Mean Menu JS jQuery('.mean-menu').meanmenu({ meanScreenWidth: "991" }); // Navbar Area $(window).on('scroll', function() { if ($(this).scrollTop() >150){ $('.navbar-area').addClass("sticky-nav"); } else{ $('.navbar-area').removeClass("sticky-nav"); } }); // FAQ Accordion JS $('.accordion').find('.accordion-title').on('click', function(){ // Adds Active Class $(this).toggleClass('active'); // Expand or Collapse This Panel $(this).next().slideToggle('fast'); // Hide The Other Panels $('.accordion-content').not($(this).next()).slideUp('fast'); // Removes Active Class From Other Titles $('.accordion-title').not($(this)).removeClass('active'); }); // Brand Slider $('.brand-slider').owlCarousel({ loop: true, margin: 30, nav: false, dots: false, autoplay: true, autoplayHoverPause: true, responsive:{ 0:{ items: 2 }, 568:{ items: 3 }, 768:{ items: 5 }, 1000:{ items: 5 } } }) // Portfolio Slider $('.portfolio-slider').owlCarousel({ loop: true, margin: 30, dots: false, autoplay: true, autoplayHoverPause: true, nav: true, navText: [ "", "" ], responsive:{ 0:{ items: 1 }, 768:{ items: 2 }, 1000:{ items: 3 } } }) // Testimonial Slider $('.testimonial-item-slider').owlCarousel({ loop: true, items: 1, dots: false, autoplay: true, autoplayHoverPause: true, nav: true, navText: [ "", "" ], }) // Service Slider $('.service-slider').owlCarousel({ center: true, loop: true, margin: 30, dots: false, autoplay: true, autoplayHoverPause: true, nav: true, navText: [ "", "" ], responsive:{ 0:{ items: 1 }, 768:{ items: 2 }, 1000:{ items: 3 } } }) // Tabs $('#tabs-item li a').on('click', function(e) { $('#tabs-item li, #prices-content .active').removeClass('active').removeClass('fadeInUp'); $(this).parent().addClass('active'); var activeTab = $(this).attr('href'); $( activeTab).addClass('active fadeInUp'); e.preventDefault(); }); // Popup Video $('.play-btn').magnificPopup({ disableOn: 700, type: 'iframe', mainClass: 'mfp-fade', removalDelay: 160, preloader: false, fixedContentPos: false }); // Client Slider $('.client-slider').owlCarousel({ center: true, loop: true, margin: 30, dots: false, autoplay: true, autoplayHoverPause: true, nav: true, navText: [ "", "" ], responsive:{ 0:{ items: 1 }, 768:{ items: 2 }, 1000:{ items: 3 } } }) // Search Botton $('.close-btn').on('click',function() { $('.search-overlay').fadeOut(); $('.search-btn').show(); $('.close-btn').removeClass('active'); }); $('.search-btn').on('click',function() { $(this).hide(); $('.search-overlay').fadeIn(); $('.close-btn').addClass('active'); }); // Subscribe form $(".newsletter-form").validator().on("submit", function (event) { if (event.isDefaultPrevented()) { // Handle The Invalid Form... formErrorSub(); submitMSGSub(false, "Please enter your email correctly"); } else { // Everything Looks Good! event.preventDefault(); } }); function callbackFunction (resp) { if (resp.result === "success") { formSuccessSub(); } else { formErrorSub(); } } function formSuccessSub(){ $(".newsletter-form")[0].reset(); submitMSGSub(true, "Thank you for subscribing!"); setTimeout(function() { $("#validator-newsletter").addClass('hide'); }, 4000) } function formErrorSub(){ $(".newsletter-form").addClass("animated shake"); setTimeout(function() { $(".newsletter-form").removeClass("animated shake"); }, 1000) } function submitMSGSub(valid, msg){ if(valid){ var msgClasses = "validation-success"; } else { var msgClasses = "validation-danger"; } $("#validator-newsletter").removeClass().addClass(msgClasses).text(msg); } // AJAX MailChimp $(".newsletter-form").ajaxChimp({ url: "https://hibootstrap.us20.list-manage.com/subscribe/post?u=60e1ffe2e8a68ce1204cd39a5&id=42d6d188d9", // Your url MailChimp callback: callbackFunction }); // Back To Top Js $('body').append('