HandyControl/doc/themes/next/source/js/schemes/muse.js
2019-04-10 22:28:09 +08:00

10 lines
503 B
JavaScript

$(document).ready(function() {
function updateFooterPosition() {
var containerHeight = $('#footer').attr('position') ? $('.container').height() + $('#footer').outerHeight(true) : $('.container').height();
if (containerHeight < window.innerHeight) $('#footer').css({ 'position': 'fixed', 'bottom': 0, 'left': 0, 'right': 0 }).attr('position', 'fixed');
else $('#footer').removeAttr('style position');
}
updateFooterPosition();
$(window).on('resize scroll', updateFooterPosition);
});