I understand that I could set an interval to automatically scroll to the bottom every so often, but that would interfere with user viewing.
I was thinking of making a call to a file to check for the amount of rows in the database, store the last checked one and compare it to the newest one. If there are more, then perform the scroll?
Any ideas to the subject would be greatly appreciated
EDIT: Solved If anyone was wondering:
//Updates the chat function Update(){ $.ajax({ type: "GET", url: "fetch_chat.php", data: { 'cond': cond, 'log' : log }, dataType: "json", cache: false, success: function(data) { if (data.text != null) { for (var i = 0; i < data.text.length; i++) { $('#container').append($(data.text)); } document.getElementById('container').scrollTop = document.getElementById('container').scrollHeight; } instanse = false; state = data.state; setTimeout('Update()', 1); }, }); }