I have a fixed position object and I want to know how far it is from the top of the window.
For some reason when I use .offset and .top, it gives me the distance to the top of the entire page, not just the window.
var sidebar = jQuery('.sidebar');
var sidebarHeight = sidebar.offset().top + $sidebar.height();
How do I get the distance just to the top of the window?