Please consult this fiddle http://jsfiddle.net/abhicodes/LasxP/
Here I want to find out visible height of #content-wrapper
while each scroll.
#header
will always have same height and it will be fixed, but footer height is different in some of my pages, so I cannot take current footer height as a standard.
If I reach end of the page then most of the area is covered by footer, then also I want just the visible portion of #content-wrapper
and same to happen in rest of the scroll. For the rest of the page where footer is not visible I can subtract header height to get visible part.
Suppose if a we are at the bottom of the page and viewport height is 600px then I would like to find out how much area of #content-wrapper
is visible to a user. Because at that time footer is also there which accomodates 100px and header accomodates 80px, so total visible height of #content-wrapper
will be 600-180 = 420px and similarly if we are at top then footer is not there and just header is there, so visible area of #content-wrapper
will be 520px.
So, moral of the story is, I want to find out at any given instance during scroll how much height of #content-wrapper
is visible to a user if you take this fiddle in consideration