summaryrefslogtreecommitdiff
path: root/crocoite/data/scroll.js
blob: 13e856d94e6dd47baa3bf11b5fcb4bef98092538 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/*	Continuously scrolls the page
 */
var __crocoite_stop__ = false;
(function(){
function scroll (event) {
	if (__crocoite_stop__) {
		return false;
	} else {
		window.scrollBy (0, window.innerHeight/2);
		document.querySelectorAll ('*').forEach (
			function (d) {
				if (d.clientHeight < d.scrollHeight) {
					d.scrollBy (0, d.clientHeight/2);
				}
			});
		return true;
	}
}
function onload (event) {
    window.setInterval (scroll, 200);
}
document.addEventListener("DOMContentLoaded", onload);
}());