I come across a solution (which includes a helpful screen rewrite fix in the comments by Luco) that fits my needs perfectly. Here is the revised code that has been fixed and tested:
// Utilizing window load event to account for image-dependent window height
$(window).bind("load", function() {
var footerHeight = 0,
footerTop = 0,
$footer = $("#footer");
positionFooter();
function positionFooter() {
footerHeight = $footer.outerHeight(); // accounting for padding/margins
footerTop = ($(window).scrollTop() + $(window).height() - footerHeight) + "px";
if (($(document.body).height() + footerHeight) < $(window).height()) {
$footer.css({
position: "absolute",
top: $footer.offset().top // accounting for padding/margins
}).stop().
animate({
top: footerTop
},-1);
} else {
$footer.css({
position: "static"
});
}
}
$(window)
.scroll(positionFooter)
.resize(positionFooter)
});
The above code functions as expected with jquery version 1.3.2. However, upon attempting to implement version 1.12.4, it no longer works correctly. Additionally, Bootstrap framework is being utilized. Can anyone shed light on why this might be happening?