Skip to content
This repository has been archived by the owner. It is now read-only.

Commit

Permalink
Update to fix sticky footer + gravity form issue
Browse files Browse the repository at this point in the history
  • Loading branch information
jmr06005 committed Feb 20, 2015
1 parent 4fc322e commit 2761c6e
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions js/cs.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,27 +219,31 @@ jQuery(document).ready(function($) {
// measures height of the page, and applies a class to absolute position the footer, or not.
// on short pages, it sticks; on tall pages, it doesn't.

var wrapperH = $('#page').outerHeight();
var wpadminbarH = $('#wpadminbar').outerHeight();
var ucheaderH = $('#uc-header').outerHeight();

function stickyFoot(wrapperHeight){
function stickyFoot(){
if (document.getElementById('page')!=null && document.getElementById('footers') !=null){
var wrapperH = $('#page').outerHeight();
var wpadminbarH = $('#wpadminbar').outerHeight();
var ucheaderH = $('#uc-header').outerHeight();
var footerH = $('#footers').outerHeight();
var windowH = window.innerHeight;
var gformH = 0;
$('.gform_wrapper').each(function(){
gformH = gformH + $(this).outerHeight();
});
windowH = windowH - wpadminbarH - ucheaderH;
if(windowH>=wrapperHeight){
if(wrapperH < gformH) wrapperH = wrapperH + gformH;
if(windowH>=wrapperH){
$('body').addClass('sticky');
} else {
$('body').removeClass('sticky');
}
}
}
$(document).ready(function(){
stickyFoot(wrapperH);
stickyFoot();
});
$(window).resize(function() {
stickyFoot(wrapperH);
stickyFoot();
});

$('.panel').on('shown.bs.collapse', function (e) {
Expand Down

0 comments on commit 2761c6e

Please sign in to comment.