I have something like a Text editor similar to the one used here (WMD Markdown Editor). The problem I have is after modifying text with JS, the textarea scrolls back to the top ...
As I remember this is an issue with one browser particularly (firefox?). You need to save and restore the scrollbar position and (depending on your design) the selected text.
var scrollTop = txtarea.scrollTop;
......
txtarea.scrollTop = scrollTop;
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.