Reputation: 10897
How do I find out the coordinates of the web page / document that is currently visible on my browser? For example, $(window).height()
returns 700 and $(document).height()
returns 3,000 i.e. my document is longer than the browser's height. I'd like to find out, after interacting with the page (e.g. scrolling), which area of my document is currently visible.
Thanks!
Upvotes: 1
Views: 577
Reputation: 14380
You could use
Height (in pixels) of the browser window viewport including, if rendered, the horizontal scrollbar.
Width (in pixels) of the browser window viewport including, if rendered, the vertical scrollbar.
Upvotes: 0
Reputation: 1245
If you use jQuery you could do:
$(document).scrollTop();
http://api.jquery.com/scrollTop/
Upvotes: 1