2017-12-12 17:40:07 -07:00
|
|
|
'use strict'
|
2017-04-12 12:32:28 -06:00
|
|
|
/* global $ */
|
2017-06-30 14:38:30 -06:00
|
|
|
|
2017-04-12 12:32:28 -06:00
|
|
|
// Push footer to bottom on pages with little content
|
2017-12-12 17:40:07 -07:00
|
|
|
function setFooter () {
|
2017-12-21 11:09:06 -07:00
|
|
|
var $windowHeight = $(window).height()
|
|
|
|
var $footerBottom = $('footer').offset().top + $('footer').height()
|
|
|
|
if ($windowHeight > $footerBottom) {
|
|
|
|
$('footer').css('margin-top', $windowHeight - $footerBottom)
|
2017-12-12 17:40:07 -07:00
|
|
|
}
|
2017-04-12 12:32:28 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
// Execute on page load
|
2017-12-12 17:40:07 -07:00
|
|
|
$(function () { setFooter() })
|
2017-04-12 12:32:28 -06:00
|
|
|
|
|
|
|
// Execute on window resize
|
2017-12-12 17:40:07 -07:00
|
|
|
$(window).resize(function () { setFooter() })
|