checking scroll position with js

Solutions on MaxInterview for checking scroll position with js by the best coders in the world

showing results for - "checking scroll position with js"
Albin
21 Nov 2017
1let scrollLeft = window.pageXOffset || document.documentElement.scrollLeft,
2scrollTop = window.pageYOffset || document.documentElement.scrollTop;Code language: JavaScript (javascript)
Nishka
04 Feb 2020
1document.documentElement.scrollTop = document.body.scrollTop = 1200;
2document.documentElement.scrollLeft = document.body.scrollLeft = 600;Code language: JavaScript (javascript)