Last active
January 9, 2025 18:47
Revisions
-
kodie revised this gist
Jan 9, 2025 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -15,5 +15,5 @@ var stickyFooter = function () { } } window.addEventListener('load', stickyFooter); window.addEventListener('resize', stickyFooter); -
kodie created this gist
Jan 9, 2025 .There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ // 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 { footer.style.bottom = null footer.style.left = null footer.style.position = null footer.style.right = null } } window.addEventListener('load', stickyFooter) window.addEventListener('resize', stickyFooter)