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

Update to fix sticky footer + gravity form issue #105

Merged
merged 1 commit into from
Feb 20, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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