Changed domains/channelnewsasia.com.js
authorAlan Knowles <alan@roojs.com>
Wed, 24 Apr 2019 09:35:18 +0000 (17:35 +0800)
committerAlan Knowles <alan@roojs.com>
Wed, 24 Apr 2019 09:35:18 +0000 (17:35 +0800)
domains/channelnewsasia.com.js

index 844743c..0d7b751 100644 (file)
         }
         
     },500);
+    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);
 })();