showing results for - "javascript css autoscroll"
Jaylene
05 Nov 2020
1// If you don't know when data comes, you can set an interval:
2window.setInterval(function() {
3  var elem = document.getElementById('yourDivWithScrollbar');
4  elem.scrollTop = elem.scrollHeight;
5}, 5000);
6
7// If you do know when data comes, you can do it like the following:
8var elem = document.getElementById('yourDivWithScrollbar');
9elem.scrollTop = elem.scrollHeight;
Berenice
16 Jul 2020
1const pageScroll = () => {
2  window.setInterval(() => {
3
4    // Scroll 10px all 25ms
5    window.scrollBy(0, 10)
6  }, 25)
7}