sync wip_alan_T6338_ssls_strict_on_screesnhots
authorAlan Knowles <alan@roojs.com>
Wed, 15 Jul 2020 03:06:54 +0000 (11:06 +0800)
committerAlan 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]

diff --git a/domains/scroll_whole_page.js b/domains/scroll_whole_page.js
new file mode 100644 (file)
index 0000000..c6c4b95
--- /dev/null
@@ -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