JavaScript: scroll position (Webkit engine) [migrated]
- by Julien
I'm currently trying to use JavaScript to find out how far down the page the user has scrolled; for Firefox 8.0, the keyword is pageYOffset.
To say things mechanically:
The page has a certain height. In Firefox, the useful object is document.documentElement.scrollHeight.
The browser's visible area also has a certain height. In Firefox, the object is window.innerHeight; in IE8, document.documentElement.clientHeight.
I need to know where the user is in the page vertically; in other words, how many pixels down the page the user has scrolled.
Does Webkit have a DOM object that refers to the current scroll position?
Thank you.