(function () {
$(document).ready(function() {
setFooterHeight();
});
$(window).resize(function() {
setFooterHeight();
});
function setFooterHeight() {
var container = $(".container"),
footer = $("footer"),
overlap = 25,
footerHeight = $(window).height() - container.height(),
totalHeight = footerHeight + overlap;
if ( footerHeight < 0 ) {
footer.css({
"margin-top" : -overlap
});
} else {
container.css({
"padding-bottom" : footerHeight
});
footer.css({
"margin-top" : -totalHeight,
"height" : totalHeight
});
}
}
})();