Answers for "js move element at the bottom of page"

CSS
2

force element to bottom of page

footer {
    position: fixed;
    bottom: 0;
}
Posted by: Guest on March-28-2021
2

javascript reach bottom of page

function getDocHeight() {	// $(document).height() value depends on browser
    var D = document;
    return Math.max(
        D.body.scrollHeight, D.documentElement.scrollHeight,
        D.body.offsetHeight, D.documentElement.offsetHeight,
        D.body.clientHeight, D.documentElement.clientHeight
    );
}
$(window).scroll(function() {
       if($(window).scrollTop() + $(window).height() == getDocHeight()) {
           alert("bottom!");
       }
});
Posted by: Guest on May-22-2021

Code answers related to "js move element at the bottom of page"

Browse Popular Code Answers by Language