admin管理员组文章数量:1410730
I don't actually code so please five me for my ignorance.
I'm trying to get / to automatically scroll to the bottom whenever it pastes new text to the page. More specifically, the chrome extension "clipboard inserter" inserts whatever's on my clipboard to this webpage, and does this every time the clipboard is updated. For example, when subtitles are being copied in real-time to my clipboard, the clipboard inserter inserts that new line into texthooker, creating a sort of history of subtitle lines that were used up to the present moment. I would like texthooker to automatically scroll to that entry the moment it is made.
What I found online scrolls to the bottom of the page in timed intervals, like every 2 seconds. For example, this line of code scrolls down 1000 pixels (I think) every 2000ms, and I only know how to use it by injecting it into chrome's console via inspect page.
setInterval(function(){ window.scrollBy(0,1000); }, 2000);
However, I want to be able to scroll up when needed to read past subtitle lines, without being interrupted every 2 seconds. Therefore the jump to the bottom of the page should only happen when a new line is inserted.
Can anyone help me out on this?
本文标签: How to automatically scroll to the bottom of the page when the page updates in ChromeStack Overflow
版权声明:本文标题:How to automatically scroll to the bottom of the page when the page updates in Chrome - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745063033a2640349.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论