Fix #5865 - fix channelnewsasia
[app.webkitpdf] / domains / channelnewsasia.com.js
index 844743c..fe6672a 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 );
+                document.body.scrollTop = 0;
+            }
+            
+        }, 10);
+    }
+    scrollTo(1000);
 })();