How to auto-move to the bottom of a block

var scrolled = false;
function updateScroll(){
    if(!scrolled){
        var element = document.getElementById("chatbox");
        element.scrollTop = element.scrollHeight;
    }
}

Advertisements

Leave a Reply