- Mar 22, 2013
- 9,143
- 10,489
I need a Gresemonkey script that scroll to bottom of a page when the page loads.
I got this:
This script is from 2009, so no surprise I have some issues with it.
1) It scrolls to bottom only when I center that tab, and not instantly. I'd like it to be more efficient on that.
2) It keeps me scrolled at the bottom of the page. If I try to scroll up it scrolls me right down again. I'd like it to just run once on page load and then stop.
Any help?
I got this:
Code:
// ==UserScript==
// @name Scroll to Bottom
// @namespace https://somesite.com/
// @description Simply scrolls to the bottom of a page
// @grant none
// ==/UserScript==
function scrollToBottom() {
window.setTimeout("window.scrollTo(0, document.body.offsetHeight);", 10);
};
window.addEventListener('mouseover',function() {
scrollToBottom()
},true);
This script is from 2009, so no surprise I have some issues with it.
1) It scrolls to bottom only when I center that tab, and not instantly. I'd like it to be more efficient on that.
2) It keeps me scrolled at the bottom of the page. If I try to scroll up it scrolls me right down again. I'd like it to just run once on page load and then stop.
Any help?