stuart-b
6/7/2016 - 2:49 PM

Fixing things to the top of a foot. Styles should go from fixed to absolute

Fixing things to the top of a foot.

Styles should go from fixed to absolute

$(window).on({
        scroll : function () {
            let footerTop    = $footer.offset().top;
            let windowBottom = $window.scrollTop() + $window.height();

            if (windowBottom >= footerTop) {
                $backToTop.addClass('is-stuck');
            }

            else if (footerTop > windowBottom) {
                $backToTop.removeClass('is-stuck');
            }
        },
    });