How to fix footer at bottom using Jquery?

Fixed footer at bottom of window using Jquery

 $(function () {
        function adjust() {
            var winH = $(window).height(),
                docH = $('document').height();

            if (docH > winH) {
                //leave it
            } else {
        $(window).on('resize', adjust);


  • $ (window).height() returns the height of the browser viewport.
  • $ (document).height() returns the height of entire HTML document.
  • .fixedfooter class will add to footer section when document height is less than window height.


See the Pen Fixed footer at bottom of window by Vinothkumar (@fedtutorial) on CodePen.0

You may also like

Leave a Reply

Your email address will not be published. Required fields are marked *