How to find how near we are from bottom of the page

How to find how near we are from bottom of the page

What I am doing is If we are scrolling page and page is reach just near the bottom (100px), I want to change the sidebar position by css,

Can anyone help me?

Thanks, but I already figured it out. did the same thing.

An easy solution to get this working would be to get the document’s total height and deduct 100px’s from this value.

Then on the scroll event figure out how far down the page the user has scrolled (e.g. using the window.pageYOffset (non ie) and document.body.scrollTop (ie) property. If the the distance the user has scrolled is equal to or greater than the lower limit of the page, then move your sidebar.

Good luck