Make footer stick to the bottom of the page

- Use JavaScript to determine height of `.page_footer` to apply padding to `body` avoiding any content overlap
- Absolute position `.page_footer` to bottom of the page
This commit is contained in:
Michael Rose 2016-07-20 09:10:37 -04:00
parent fc0f8f5b1d
commit 9a9cbc01e3
5 changed files with 37 additions and 6 deletions

View file

@ -2,6 +2,12 @@
BASE ELEMENTS
========================================================================== */
html {
/* sticky footer fix */
position: relative;
min-height: 100%;
}
body {
margin: 0;
padding: 0;

View file

@ -5,6 +5,13 @@
.page__footer {
@include full();
@include clearfix;
/* sticky footer fix start */
position: absolute;
bottom: 0;
width: 100%;
clear: both;
height: auto;
/* sticky footer fix end */
margin-top: 3em;
color: mix(#fff, $gray, 25%);
animation: intro 0.3s both;

File diff suppressed because one or more lines are too long

View file

@ -4,6 +4,24 @@
$(document).ready(function(){
// Sticky footer
var bumpIt = function() {
$('body').css('margin-bottom', $('.page__footer').outerHeight(true));
},
didResize = false;
bumpIt();
$(window).resize(function() {
didResize = true;
});
setInterval(function() {
if(didResize) {
didResize = false;
bumpIt();
}
}, 250);
// FitVids init
$("#main").fitVids();

10
assets/js/main.min.js vendored

File diff suppressed because one or more lines are too long