Skip to content

Instantly share code, notes, and snippets.

View kodie's full-sized avatar

Kodie Grantham kodie

View GitHub Profile
@kodie
kodie / stickyFooter.js
Last active January 9, 2025 18:47
Ensures the highest the footer will ever be on the screen is the bottom of the viewport
// Ensures the highest the footer will ever be on the screen is the bottom of the viewport
var stickyFooter = function () {
var footer = document.querySelector('footer')
if (window.innerHeight > document.body.scrollHeight) {
footer.style.bottom = 0
footer.style.left = 0
footer.style.position = 'fixed'
footer.style.right = 0
} else {