Advertisement
CSenshi

footer.jsp

Jul 28th, 2020
1,165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.65 KB | None | 0 0
  1.  
  2. <script>
  3.     function adjustFooter(){
  4.         var viewPortHeight = $(window).height();
  5.  
  6.         var footerHeight= $("footer").outerHeight(true);
  7.         var contentHeight = $("main").outerHeight(true);
  8.         var headerHeight = $("header").outerHeight(true);
  9.  
  10.         console.log(contentHeight  )
  11.         console.log(footerHeight  )
  12.         console.log(headerHeight  )
  13.         console.log(viewPortHeight )
  14.         if( contentHeight + headerHeight + footerHeight < viewPortHeight){
  15.            $("footer").addClass("fixed")
  16.        }
  17.        return 1;
  18.    }
  19.    window.onresize = adjustFooter;
  20.    $(document).ready(adjustFooter);
  21. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement