![](/img/trans.png)
[英]How would I make my scroll bar automatically fix itself to to the bottom of a div?
[英]How would I make a div automatically scroll to the bottom?
你去了: http : //jsfiddle.net/tMnvJ/
只需将JavaScript代码放在一个函数中,然后通过添加内容的任何进程调用它。 像这样......
function addParagraph()
{
//do you add paragraph stuff...
//then call this line to scroll to the bottom of your div
document.getElementById('myDiv').scrollTop = document.getElementById('myDiv').scrollHeight;
}
希望有所帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.