I'm trying to create a script that finds the coordinates of the top-left and the bottom-right corners of the window viewport depending on the scrolling.
To achieve this I need the total page height/width and the amount of vertical/horizontal scrolling.
My problem is that there are so many different properties that can be applied to window
, document
, body
, ...etc. I'm not event talking about the different browsers.
So basically my question is the following :
- Ho can I get the total page height/width, the viewport size and the amount of vertial/horizontal scrolling in a cross browser compatible way without jQuery ?
Thank you a lot in advance !
I started using the answer posted here : JavaScript get window X/Y position for scroll but it's just part of the whole answer I think.