最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

How to automatically scroll to the bottom of the page when the page updates in Chrome - Stack Overflow

programmeradmin0浏览0评论

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?

发布评论

评论列表(0)

  1. 暂无评论