My application is chat. I have a div for wrapping messages, each message is a div, so after a few posts my DOM looks like this:
<div id = "divChatHistory">
<div id = "msg1> Message number one </div>
<div id = "msg2> Message number two </div>
<div id = "msg3> Message number three </div>
// ...
</div>
Now you need an auto-scrool divChatHistory for each message, and its really simple:
function AutoScroll() {
$('#<%= divChatHistory.ClientID%>').scrollTop(100000000000);
}
but it only works in Internet Explorer (IE) in FireFox (FF) does not occur.
Any idea?
source
share