feelfree82

footer hack

Feb 24th, 2012
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. $(function(){
  2. positionFooter();
  3. function positionFooter(){
  4. var padding_top = $("#footer").css("padding-top").replace("px", "");
  5. var page_height = $(document.body).height() - padding_top;
  6. var window_height = $(window).height();
  7. var difference = window_height - page_height;
  8. if (difference < 0)
  9. difference = 0;
  10.  
  11. $("#footer").css({
  12. padding: difference + "px 0 0 0"
  13. })
  14. }
  15.  
  16. $(window)
  17. .resize(positionFooter)
  18. });
Add Comment
Please, Sign In to add comment