(function($) { 'use strict'; function PagePreloader() { jQuery('body').removeClass('no-js'); } jQuery(window).load(function($) { PagePreloader(); }); } )(window.jQuery); /* -------------------------------------------- JS Start -------------------------------------------- */ jQuery(document).ready(function($) { /* call foundation */ $(document).foundation(); // sticky menu animation $('.sticky_menu.sticky').on('sticky.zf.stuckto:top', function() { $(this).addClass(' fadeInDown'); }).on('sticky.zf.unstuckfrom:top', function() { $(this).removeClass(' fadeInDown'); }) // scrollup jQuery(window).bind("scroll", function() { if (jQuery(this).scrollTop() > 800) { jQuery(".scroll_to_top").fadeIn('slow'); } else { jQuery(".scroll_to_top").fadeOut('fast'); } }); jQuery(".scroll_to_top").click(function() { jQuery("html, body").animate({ scrollTop: 0 }, "slow"); return false; }); // sticky header $(window).on("scroll", function() { if($(window).scrollTop() > 100) { $(".header3.sticky").addClass("active"); } else { //remove the background property so it comes transparent again (defined in your css) $(".header3.sticky").removeClass("active"); } }); if (Foundation.MediaQuery.atLeast('medium')) { // Adjust height of header 3 var divHeight = $('.header3').outerHeight(); $('.page-thumb').css('padding-top', divHeight+'px'); $('.heade-page-nothumb').css('padding-top', divHeight+'px'); var divHeightcontent = $('.header3').outerHeight()+30; $('#content-page.no-page-header').css('padding-top', divHeightcontent+'px'); var divHeightsub = $('.header3').outerHeight(); $('#sub_banner').css('padding-top', divHeightsub+'px'); var divHeightblog = $('.header3').outerHeight(); $('.home.blog #blog-content').css('padding-top', divHeightblog+'px'); } var big_image = $( '.header-filter[data-parallax="active"]' ); if ( big_image.length !== 0 ) { $( window ).on( 'scroll', debounce( function () { var oVal = ($( window ).scrollTop() /6); big_image.css( { 'transform': 'translate3d(0,' + oVal + 'px,0)', '-webkit-transform': 'translate3d(0,' + oVal + 'px,0)', '-ms-transform': 'translate3d(0,' + oVal + 'px,0)', '-o-transform': 'translate3d(0,' + oVal + 'px,0)' } ); }, 4 ) ); } }); // END /* -------------------------------------------- JS END -------------------------------------------- */