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?
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745063034a4609082.html
评论列表(0条)