Scrolling to the bottom of a DIV
Hi - I'm grabbing some data (chat type application) from a web page (which just returns data queried from the database), and places it in a scrolling DIV element. What I then want to do is scroll to the bottom of the DIV, so that the last conversations pulled from the database, are shown (in the same wasy as Office Communicator or Instant Messaging work).
My code below, just seems to scroll a little down the DIV and then stop - is there a way to get it to go to the bottom?
Thanks for any help,
Mark
-
$.ajax({
-
url:
'getwb.aspx',
-
success:
function
(data) {
-
$(
'#availabilityMessage'
).html(data);
-
$(
"#availabilityMessage"
).animate({ scrollTop: $(
"#availabilityMessage"
).attr(
"scrollHeight"
) - $(
'#availabilityMessage'
).height() }, 1000);
-
}
-
}