How do I find the vertical distance from the top of the page to where the element exist in the DOM using javascript/jQuery?
I\'ve something like
Rob W's answer is correct - that will give you the offset from the top of the full page.
If you want to get the offset from the top of the viewable screen, you should do this:
var viewableOffset = $("#li.test").offset().top - $(window).scrollTop();
Hope that helps!