/************************************************************************ Template Name : Anagha | Responsive Bootstrap 4.1.3 Business Template Author : Fuduthemes Version : 1.0.0 Created : 2020 File Description : Custom js file of the template **************************************************************************/ $(function() { "use strict"; /* Scroll Animation Active */ new WOW().init(); /* ---------------------------------------------------------------- [ slick responsive(team section) ] -----------------------------------------------------------------*/ // $(function(){ // $('.slider-responsive').slick({ // arrows: false, // dots: true, // infinite: true, // slidesToShow: 3, // slidesToScroll: 1, // autoplay: true, // autoplaySpeed: 3000, // pauseOnHover: true, // responsive: [ // { // breakpoint: 991.98, // settings: { // slidesToShow: 2 // } // },{ // breakpoint: 767.98, // settings: { // slidesToShow: 1 // } // },{ // breakpoint: 575.98, // settings: { // slidesToShow: 1 // } // }] // }); // }); /* ---------------------------------------------------------------- [ slick responsive(testimonial section) ] -----------------------------------------------------------------*/ // $(function(){ // $('.testimonial-responsive').slick({ // dots: false, // infinite: true, // slidesToShow: 3, // slidesToScroll: 1, // autoplay: true, // autoplaySpeed: 3000, // pauseOnHover: true, // responsive: [{ // breakpoint: 1199.98, // settings: { // slidesToShow: 2 // } // }, { // breakpoint: 767.98, // settings: { // slidesToShow: 1 // } // }] // }); // }); /* ---------------------------------------------------------------- [ slick responsive(feedback section) ] -----------------------------------------------------------------*/ // $(function(){ // $('.fs-feedback-responsive').slick({ // arrows: false, // dots: false, // infinite: true, // slidesToShow: 1, // slidesToScroll: 1, // autoplay: true, // autoplaySpeed: 3000, // pauseOnHover: true // }); // }); jQuery('.left-arrow').on('click', function(){ jQuery('.slider').slick('slickPrev'); }); jQuery('.right-arrow').on('click', function(){ jQuery('.slider').slick('slickNext'); }); /* ---------------------------------------------------------------- [ Back To Up ] -----------------------------------------------------------------*/ jQuery(function(){ var offset = 220; var duration = 300; jQuery(window).on('scroll', function() { if (jQuery(this).scrollTop() > offset) { jQuery('.fs-back-to-top').fadeIn(duration); } else { jQuery('.fs-back-to-top').fadeOut(duration); } }); jQuery('.fs-back-to-top').on('click', function(event) { event.preventDefault(); jQuery('html, body').animate({scrollTop: 0}, duration); return false; }); if(jQuery(window).scrollTop() > offset) { jQuery('.fs-back-to-top').fadeOut(0); } }); /* ---------------------------------------------------------------- [ Navbar scrolled transation ] -----------------------------------------------------------------*/ jQuery(function () { jQuery(document).on('scroll', function () { var $nav = jQuery(".fixed-top"); $nav.toggleClass('scrolled', jQuery(this).scrollTop() > $nav.height()-40); }); }); jQuery(document).ready(function(){ jQuery(this).scrollTop(0); }); /* ---------------------------------------------------------------- [ DropDown Menu] -----------------------------------------------------------------*/ jQuery(document).on({ mouseenter: function() { jQuery(this).find('.dropdown-menu').stop(true, true).delay(100).fadeIn(100); }, mouseleave: function() { jQuery(this).find('.dropdown-menu').stop(true, true).delay(100).fadeOut(100); } }, 'ul li.dropdown'); }); /*-------------------------------------------------------*/ /*------HEADER STICKY------*/ /*jQuery( document ).ready(function() { var $nav = jQuery(".fs-middle-header"); $nav.removeClass('fixed-top'); jQuery(document).scroll(function() { $nav.toggleClass('fixed-top', jQuery(this).scrollTop() > $nav.height()); }); });*/ /*-------------------------------------------------*/ /*------magnificy galllery popup---------*/ jQuery(document).ready(function() { jQuery('.fs-gallery').magnificPopup({ delegate: '.image_popup', type: 'image', tLoading: 'Loading image #%curr%...', mainClass: 'mfp-img-mobile', gallery: { enabled: true, navigateByImgClick: true, preload: [0,1] // Will preload 0 - before current, and 1 after the current image }, image: { tError: 'The image #%curr% could not be loaded.', titleSrc: function(item) { //return item.el.attr('title') + 'by Solodev'; } } }); }); /*----------------Menu data attribute------------------------*/ jQuery(document).ready(function() { window.addEventListener("load", function () { "use strict"; const loader = document.querySelector(".fs-loader"); if( loader ) { loader.className += " hidden"; } }); jQuery('#top-menu a.nav-link').each(function() { jQuery(this).attr('data-hover', jQuery(this).text()); }); }); /*--------------Blog Image hover effect------------------------------*/ /* Demo purposes only */ $(".hover").mouseleave( function() { $(this).removeClass("hover"); } );