I have a script doing a task much like a regular chat. Whenever I load new messages I fill a div like this:
....
<div class="conversation">
<span class="sender">Sender: </span><span>Message sent by sender..</span>
</div>
....
Then, using jQuery I do something like this:
var lastOne = $("div.conversation:last", itemBox).offset();
itemBox.scrollTop(lastOne.top);
When I'm having a few (~40 messages) it works ok, but when the list grows too large, it starts calculating the offset wrong. This happens specially with large messages, taking over 3 lines. I'm not using any float inside the chat box (parent of all div.conversation), so I'm really shocked here...
Thanks in advance
itemBoxin$("div.conversation:last", itemBox).offset();? I didn't know that you could pass 2 arguments to jquery when selecting..