From 667ccca0b1392f319f18390a091cdd4c384aa0d1 Mon Sep 17 00:00:00 2001 From: Salman Date: Fri, 1 Aug 2014 11:16:58 -0400 Subject: [PATCH] Sticky class fix Changed the way window height was calculated (IE 7/8 couldn't find the height) --- js/cs.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/js/cs.js b/js/cs.js index dcdd7ba..ec1db1a 100644 --- a/js/cs.js +++ b/js/cs.js @@ -219,11 +219,12 @@ function stickyFoot(){ var wrapperH = document.getElementById('page').clientHeight; var footerH = document.getElementById('footers').clientHeight; var comboH = wrapperH + footerH; - var windowH = window.innerHeight; - if(windowH>=comboH){ - $('body').addClass('sticky') + var windowH = $(window).innerHeight(); + + if(windowH >= comboH){ + $('body').addClass('sticky'); } else { - $('body').removeClass('sticky') + $('body').removeClass('sticky'); } } window.onload = function (){