Automatically scroll top-to-bottom and bottom-to-top a webpage. DEMO
$ yarn add htmlautoscroll
# or
$ npm install --save htmlautoscroll
<script src="htmlautoscroll.js"></script>
<script type="text/javascript">
// start scrolling
htmlautoscrollStart(
10, // scrolling speed in pixel per sec
2000, // time to wait when an extremity is reached in milliseconds
(bottom) => console.log('reached', bottom ? 'bottom' : 'top') // callback when an extremity is reached
);
// stop scrolling
htmlautoscrollStop();
</script>