1
Answer

Sticky footer code

Guest User

Guest User

3y
497
1

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)