0

Do any of you know why scrollTo and scrollBy methods in Chrome are not working. In other browsers eg Firefox it works. I can fix the issue by adding a setTimeout. An eventListener like load or DOMContentloaded is not working. Thanks and VG.

<script>
scrollTo(0,200); // does not work
setTimeout(function a() {scrollTo(0,200);},1); //works.
</script>
mtx
  • 1,012
  • 1
  • 16
  • 38
Kat
  • 1
  • 1
  • This might help you, https://stackoverflow.com/a/15694294/3511390 give it a try. – Ray Apr 08 '22 at 17:10

0 Answers0