As part of an ajax chat room (using prototype framework) I am working on I scroll the user to the bottom each time a message is added using the below js.
However if the user has scrolled up and the list up dates it jumps to the bottom.
Is there any way to detect if the user has scrolled and then disable this function, but also detect when the user is at the bottom again so the js can be re-enabled?
var objDiv = document.getElementById("chat");
objDiv.scrollTop = objDiv.scrollHeight;