I'm making something where a textarea gets more and more text appended. In firefox, the textarea scroll back up to the top each time. I currently have something like textarea.scrollTop=1000000;
to scroll it back down each time it changes, but it still goes up to the top for a very short time. Is there any way to stop it doing so?
I ran into this problem, too. It happens in IE and Firefox but not Opera and Chrome.
I thought of hiding the momentary jumps to the top by " double-buffering " changes to the textarea:
You can swap the hidden/visible textareas by using one of two methods:
我通过脚本添加内容的问题,粘贴你的文本附加到textarea的代码
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.