projects
/
app.webkitpdf
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
532e5f9
)
sync
wip_alan_T6338_ssls_strict_on_screesnhots
author
Alan Knowles
<alan@roojs.com>
Wed, 15 Jul 2020 03:06:54 +0000
(11:06 +0800)
committer
Alan Knowles
<alan@roojs.com>
Wed, 15 Jul 2020 03:06:54 +0000
(11:06 +0800)
domains/scroll_whole_page.js
[new file with mode: 0644]
patch
|
blob
diff --git a/domains/scroll_whole_page.js
b/domains/scroll_whole_page.js
new file mode 100644
(file)
index 0000000..
c6c4b95
--- /dev/null
+++ b/
domains/scroll_whole_page.js
@@ -0,0
+1,17
@@
+(function() {
+ var scrollTo = function(duration) {
+ var to = document.body.scrollHeight;
+ if (duration <= 0) return;
+ var difference = to - document.body.scrollTop;
+ var perTick = difference / duration * 10;
+
+ var sid = setInterval(function() {
+ document.body.scrollTop = document.body.scrollTop + perTick;
+ if (document.body.scrollTop > to) {
+ clearInterval(sid );
+ }
+
+ }, 10);
+ }
+ scrollTo(1000);
+})()
\ No newline at end of file