NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript==
// @name KeepDown!
// @version 0.2
// @description It creates 2 buttons to keep the page scrolled to the bottom.
// @match *
// @copyright 2014+, Okon3 (https://github.com/okon3)
// @oujs:author okon3
// ==/UserScript==
var scrollTimer;
$( document ).ready(function() {
$('body').append('<div id="scrollButtons"><p><center><b>Autoscroll</b></center></p><p><button id="startScroll">START</button><button id="stopScroll">STOP</button></div></p>');
$('#startScroll').click(startTimer);
$('#stopScroll').click(stopTimer);
$('#scrollButtons').css({
'position':'fixed',
'bottom':'50px',
'left':'50px',
'border-radius':'6px',
'border':'1px solid #000',
'padding':'5px',
'background': 'rgba(255, 255, 255, 0.8)'
});
$('#startScroll').css({
'background':'-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #44c767), color-stop(1, #5cbf2a))',
'background':'-moz-linear-gradient(top, #44c767 5%, #5cbf2a 100%)',
'background':'-webkit-linear-gradient(top, #44c767 5%, #5cbf2a 100)',
'background':'-o-linear-gradient(top, #44c767 5%, #5cbf2a 100%)',
'background':'-ms-linear-gradient(top, #44c767 5%, #5cbf2a 100%)',
'background':'linear-gradient(to bottom, #44c767 5%, #5cbf2a 100%)',
'filter:progid':'DXImageTransform.Microsoft.gradient(startColorstr="#44c767", endColorstr="#5cbf2a",GradientType=0)',
'background-color':'#44c767',
'-moz-border-radius':'6px',
'-webkit-border-radius':'6px',
'border-radius':'6px',
'border':'1px solid #18ab29',
'display':'inline-block',
'cursor':'pointer',
'color':'#000',
'font-family':'arial',
'font-size':'13px',
'padding':'2px 18px',
'text-decoration':'none',
'text-shadow':'0px 0px 0px #2f6627'
});
$('#stopScroll').css({
'background':'-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #d0451b), color-stop(1, #bc3315))',
'background':'-moz-linear-gradient(top, #d0451b 5%, #bc3315 100%)',
'background':'-webkit-linear-gradient(top, #d0451b 5%, #bc3315 100%)',
'background':'-o-linear-gradient(top, #d0451b 5%, #bc3315 100%)',
'background':'-ms-linear-gradient(top, #d0451b 5%, #bc3315 100%)',
'background':'linear-gradient(to bottom, #d0451b 5%, #bc3315 100%)',
'filter:progid':'DXImageTransform.Microsoft.gradient(startColorstr="#d0451b", endColorstr="#bc3315",GradientType=0)',
'background-color':'#d0451b',
'-moz-border-radius':'6px',
'-webkit-border-radius':'6px',
'border-radius':'6px',
'border':'1px solid #942911',
'display':'inline-block',
'cursor':'pointer',
'color':'#000',
'font-family':'arial',
'font-size':'13px',
'padding':'2px 18px',
'text-decoration':'none',
'text-shadow':'0px 0px 0px #854629',
'margin-left':'5px'
});
});
function scrolltobottom(){
document.body.scrollTop = document.body.scrollHeight;
}
function startTimer(){
scrolltobottom();
scrollTimer = setInterval(scrolltobottom,2000);
}
function stopTimer(){
clearInterval(scrollTimer);
}