Created
May 23, 2013 21:45
-
-
Save jlittlejohn/5639677 to your computer and use it in GitHub Desktop.
JS: Sticky Footer
This file contains hidden or 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 characters
function stickyNav() { | |
var footer = $("footer"); | |
var pos = footer.position(); | |
var height = $(window).height(); | |
height = height - pos.top; | |
height = height - footer.height(); | |
if (height > 0) { | |
footer.css({'margin-top' : height+'px'}); | |
} | |
} | |
$(window).bind("load resize", stickyNav); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment