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:
parent
fc0f8f5b1d
commit
9a9cbc01e3
5 changed files with 37 additions and 6 deletions
|
@ -2,6 +2,12 @@
|
||||||
BASE ELEMENTS
|
BASE ELEMENTS
|
||||||
========================================================================== */
|
========================================================================== */
|
||||||
|
|
||||||
|
html {
|
||||||
|
/* sticky footer fix */
|
||||||
|
position: relative;
|
||||||
|
min-height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
|
|
@ -5,6 +5,13 @@
|
||||||
.page__footer {
|
.page__footer {
|
||||||
@include full();
|
@include full();
|
||||||
@include clearfix;
|
@include clearfix;
|
||||||
|
/* sticky footer fix start */
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0;
|
||||||
|
width: 100%;
|
||||||
|
clear: both;
|
||||||
|
height: auto;
|
||||||
|
/* sticky footer fix end */
|
||||||
margin-top: 3em;
|
margin-top: 3em;
|
||||||
color: mix(#fff, $gray, 25%);
|
color: mix(#fff, $gray, 25%);
|
||||||
animation: intro 0.3s both;
|
animation: intro 0.3s both;
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -4,6 +4,24 @@
|
||||||
|
|
||||||
$(document).ready(function(){
|
$(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
|
// FitVids init
|
||||||
$("#main").fitVids();
|
$("#main").fitVids();
|
||||||
|
|
||||||
|
|
10
assets/js/main.min.js
vendored
10
assets/js/main.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue