Skip to content

Commit

Permalink
Sticky class fix
Browse files Browse the repository at this point in the history
Changed the way window height was calculated (IE 7/8 couldn't find the
height)
  • Loading branch information
szk11001 committed Aug 1, 2014
1 parent 8ddb5af commit 667ccca
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions js/cs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 (){
Expand Down

0 comments on commit 667ccca

Please sign in to comment.