Guest User

Guest User

  • Tech Writer
  • 75
  • 449

Sticky footer code

Jun 7 2021 5:28 AM

I have use this code for sticky footer 

 $(document).ready(function () {
        var contentHeight = $(window).height();
        var footerHeight = $('.footer').height();
        var footerTop = $('.footer').position().top + footerHeight;
        if (footerTop < contentHeight) {
            $('.footer').css('margin-top'+ 1 (contentHeight - footerTop) + 'px');
        }
    });

This is not working not set footer in bottom without any content.


Answers (1)