(function($){ "use strict"; //===== Prealoder $(window).on('load', function (event) { $('#preloader').delay(500).fadeOut(500); }); //===== Sticky $(window).on('scroll', function (event) { var scroll = $(window).scrollTop(); if (scroll < 110) { $(".navigation").removeClass("sticky"); } else { $(".navigation").addClass("sticky"); } }); //===== Mobile Menu $(".navbar-toggler").on('click', function () { $(this).toggleClass('active'); }); $(".navbar-nav a").on('click', function () { $(".navbar-toggler").removeClass('active'); }); var subMenu = $(".sub-menu-bar .navbar-nav .sub-menu"); if (subMenu.length) { subMenu.parent('li').children('a').append(function () { return ''; }); var subMenuToggler = $(".sub-menu-bar .navbar-nav .sub-nav-toggler"); subMenuToggler.on('click', function () { $(this).parent().parent().children(".sub-menu").slideToggle(); return false }); } //===== Section Menu Active var scrollLink = $('.page-scroll'); // Active link switching $(window).scroll(function() { var scrollbarLocation = $(this).scrollTop(); scrollLink.each(function() { var sectionOffset = $(this.hash).offset().top - 90; if ( sectionOffset <= scrollbarLocation ) { $(this).parent().addClass('active'); $(this).parent().siblings().removeClass('active'); } }); }); //===== Back to top // Show or hide the sticky footer button $(window).on('scroll', function (event) { if ($(this).scrollTop() > 600) { $('.back-to-top').fadeIn(200) } else { $('.back-to-top').fadeOut(200) } }); //Animate the scroll to yop $('.back-to-top').on('click', function (event) { event.preventDefault(); $('html, body').animate({ scrollTop: 0, }, 1500); }); // Single Features Active $('.blog-item-area').on('mouseover', '.single-blog', function() { $('.single-blog.active').removeClass('active'); $(this).addClass('active'); }); //===== })(jQuery);