diff --git a/js/cs.js b/js/cs.js index db0aa92..9e4244e 100644 --- a/js/cs.js +++ b/js/cs.js @@ -246,6 +246,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();