问题
I am working on my own chat. And on one main window I have more chat windows(divs). And I want when I load my main windows, that my chat divs was scrolled on bottom. Have you any solutions?
回答1:
$('#div1').scrollTop($('#div1')[0].scrollHeight);
this is your solution :D
http://jsfiddle.net/emx9D/
回答2:
There's a number of different jQuery solutions that do this, take a look at them here
The general gist of it, is browser detects you're at the bottom of the page, do an ajax query, append onto page.
来源:https://stackoverflow.com/questions/17695726/scroll-on-bottom-divs