php auto scoll page with output

Solutions on MaxInterview for php auto scoll page with output by the best coders in the world

showing results for - "php auto scoll page with output"
Jazmín
24 Oct 2018
1<script>
2var scroller = setInterval(function() {  
3    window.scrollTo(0,document.body.scrollHeight);
4}, 10); // update every 10 ms, change at will
5</script>
6<?php
7// generate 1000 lines of html code
8for($i=0; $i<1000; $i++){
9    echo $i . "<br>";
10    ob_flush(); // flush out the output as we go
11    flush(); // same
12    usleep(10000); // add some delay to see it in action  
13}
14
15?>
16
17<script>
18clearInterval(scroller); // stop updating so that you can scroll up 
19</script>
20