diff --git a/js/cs.js b/js/cs.js index db0aa92..98bc9ef 100644 --- a/js/cs.js +++ b/js/cs.js @@ -228,6 +228,7 @@ function stickyFoot(){ var footerH = $('#footers').outerHeight(); var windowH = window.innerHeight; var gformH = 0; + console.log(wrapperH); $('.gform_wrapper').each(function(){ gformH = gformH + $(this).outerHeight(); }); @@ -246,6 +247,25 @@ $(window).resize(function() { $(window).load(function() { stickyFoot(); }); +function onElementHeightChange(elm, callback){ + var lastHeight = elm.clientHeight, newHeight; + (function run(){ + newHeight = elm.clientHeight; + if( lastHeight != newHeight ) + callback(); + lastHeight = newHeight; + + if( elm.onElementHeightChangeTimer ) + clearTimeout(elm.onElementHeightChangeTimer); + + elm.onElementHeightChangeTimer = setTimeout(run, 200); + })(); +} + + +onElementHeightChange(document.body, function(){ + stickyFoot(); +}); $('.panel, .collapse').on('shown.bs.collapse', function (e) { stickyFoot();