mirror of
https://gitee.com/handyorg/HandyControl.git
synced 2024-12-04 04:47:39 +08:00
10 lines
503 B
JavaScript
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);
|
|
});
|