(function($) { "use strict"; $(window).on('load', function() { /*Page Loader active ========================================================*/ $('#preloader').fadeOut(); // Sticky Nav $(window).on('scroll', function() { if ($(window).scrollTop() > 120) { $('.scrolling-navbar').addClass('top-nav-collapse'); $('.dropdown').css('color','#000'); $('.slicknav_btn').css('border-color','#E91E63'); $('.slicknav_icon-bar').css('background-color','#E91E63'); } else { $('.scrolling-navbar').removeClass('top-nav-collapse'); $('.dropdown').css('color','#fff'); $('.slicknav_btn').css('border-color','#fff'); $('.slicknav_icon-bar').css('background-color','#fff'); } }); /* ========================================================================== countdown timer ========================================================================== */ jQuery('#clock').countdown('2018/06/21',function(event){ var $this=jQuery(this).html(event.strftime('' +'
%-D Days
' +'
%H Hours
' +'
%M Minutes
' +'
%S Seconds
')); }); /* slicknav mobile menu active */ $('.mobile-menu').slicknav({ prependTo: '.navbar-header', parentTag: 'liner', allowParentLinks: true, duplicate: true, label: '', }); /* WOW Scroll Spy ========================================================*/ var wow = new WOW({ //disabled for mobile mobile: false }); wow.init(); /* Nivo Lightbox ========================================================*/ $('.lightbox').nivoLightbox({ effect: 'fadeScale', keyboardNav: true, }); // one page navigation $('.navbar-nav').onePageNav({ currentClass: 'active', filter: ':not(.external)' }); /* Back Top Link active ========================================================*/ var offset = 200; var duration = 500; $(window).scroll(function() { if ($(this).scrollTop() > offset) { $('.back-to-top').fadeIn(400); } else { $('.back-to-top').fadeOut(400); } }); $('.back-to-top').on('click',function(event) { event.preventDefault(); $('html, body').animate({ scrollTop: 0 }, 600); return false; }); }); }(jQuery)); jQuery.fn.center = function () { this.css("position","absolute"); this.css("top", (($(window).height() - this.outerHeight()) / 2) + $(window).scrollTop() + "px"); this.css("left", (($(window).width() - this.outerWidth()) / 2) + $(window).scrollLeft() + "px"); return this; }