Answer the question
In order to leave comments, you need to log in
Remembering the scroll position in the browser?
Hello.
Browsers are getting smarter and smarter. If you look at half the page and then refresh it, the focus will remain on what you have not read. And that's great.
Does anyone know what this is called and is it possible to see it in js?
Answer the question
In order to leave comments, you need to log in
function getBodyScrollTop()
{
return self.pageYOffset || (document.documentElement && document.documentElement.scrollTop) || (document.body && document.body.scrollTop);
}
returns the number of pixels on the page that are not visible from above.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question