rashidr — 2010-09-28T19:12:53-04:00 — #1
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?
rashidr — 2010-09-30T10:54:36-04:00 — #2
Thanks, but I already figured it out. did the same thing.
slickau — 2010-09-30T03:10:31-04:00 — #3
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.