Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- function adjustFooter(){
- var viewPortHeight = $(window).height();
- var footerHeight= $("footer").outerHeight(true);
- var contentHeight = $("main").outerHeight(true);
- var headerHeight = $("header").outerHeight(true);
- console.log(contentHeight )
- console.log(footerHeight )
- console.log(headerHeight )
- console.log(viewPortHeight )
- if( contentHeight + headerHeight + footerHeight < viewPortHeight){
- $("footer").addClass("fixed")
- }
- return 1;
- }
- window.onresize = adjustFooter;
- $(document).ready(adjustFooter);
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement