I\'m trying to get the position of an element within the window like so:
var link = $(element);
var offset = link.offset();
var top = offset.top;
var left =
I think
Testing
The result are
top: 44
bottom: 544
left: 72
right: 1277
bottomFromBottom: 3068
rightFromRight: 3731
in chrome browser of mine.
When the document is scrollable, $(window).height()
returns height of browser viewport, not the width of document of which some parts are hiden in scroll. See http://api.jquery.com/height/ .