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?