Forum Moderators: open
So if a user submits a long message that takes up 3 lines in the div, it will scroll down and then pop up a couple lines. The more lines it wraps around, the futher it will pop up. (I hope ive explained it clearly enough).
The following is a snippet of javascript that fills up the div and then scrolls to the bottom.
for (var i=0; i<messageCount; i++)
{
$('chatwindow').innerHTML = $('chatwindow').innerHTML +
'<p class="message">[' + newMessages[i].timestamp_display + '] <span class="screenname">' +
newMessages[i].author + ': </span>' + newMessages[i].text
+ '</p>';
}
$('chatwindow').scrollTop = $('chatwindow').scrollHeight;
Any help would be appreciated.