From a19d9d68c82c085ad943f1e5eacfe62927b37609 Mon Sep 17 00:00:00 2001 From: Jack Lamberti Date: Mon, 2 Nov 2015 10:30:43 -0500 Subject: [PATCH] Added in scrollpage call from AnimateHeader update --- js/cbpAnimatedHeader.js | 5 +++-- js/cbpAnimatedHeader.min.js | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/js/cbpAnimatedHeader.js b/js/cbpAnimatedHeader.js index 4554e2e..352761e 100644 --- a/js/cbpAnimatedHeader.js +++ b/js/cbpAnimatedHeader.js @@ -13,9 +13,10 @@ var cbpAnimatedHeader = (function() { var docElem = document.documentElement, header = document.querySelector( '.navbar-default' ), didScroll = false, - changeHeaderOn = 300; + changeHeaderOn = 220; function init() { + scrollPage(); window.addEventListener( 'scroll', function( event ) { if( !didScroll ) { didScroll = true; @@ -41,4 +42,4 @@ var cbpAnimatedHeader = (function() { init(); -})(); \ No newline at end of file +})(); diff --git a/js/cbpAnimatedHeader.min.js b/js/cbpAnimatedHeader.min.js index 18d66a3..9fd3d80 100644 --- a/js/cbpAnimatedHeader.min.js +++ b/js/cbpAnimatedHeader.min.js @@ -8,4 +8,4 @@ * Copyright 2013, Codrops * http://www.codrops.com */ -var cbpAnimatedHeader=(function(){var b=document.documentElement,g=document.querySelector(".navbar-default"),e=false,a=300;function f(){window.addEventListener("scroll",function(h){if(!e){e=true;setTimeout(d,250)}},false)}function d(){var h=c();if(h>=a){classie.add(g,"navbar-shrink")}else{classie.remove(g,"navbar-shrink")}e=false}function c(){return window.pageYOffset||b.scrollTop}f()})(); +var cbpAnimatedHeader=(function(){var b=document.documentElement,g=document.querySelector(".navbar-default"),e=false,a=220;function f(){d();window.addEventListener("scroll",function(h){if(!e){e=true;setTimeout(d,250)}},false)}function d(){var h=c();if(h>=a){classie.add(g,"navbar-shrink")}else{classie.remove(g,"navbar-shrink")}e=false}function c(){return window.pageYOffset||b.scrollTop}f()})();