views:

26

answers:

1

I don't even know what I want to do would be called

Please take a quick look at this page:

http://www.philsalesses.com/plasma-pong/

You'll see the title Plasma Pong and an image under it, on the left side. When I scroll the article, I'd like it to stay put while the page scrolls. However, you'll notice when you get the bottom of the page, there is a footer and there wouldn't be enough room for the title and image if I just made it completely static.

I'd like that to stay put until the footer hits, then scroll. When you scroll back up the page, it will scroll a little bit, until there is room, then stay put again. The same effect, but in reverse. Any idea what to look up how I could do this?

+1  A: 

Set the titles css position to fixed. Then use javascript to detect a scroll event when certain criteria are met reset it to an absolute position so that it stays above the footer. Then when remove the absolute positioning when the page is scrolled away from the footer. To see a working example go to quirksmode.org. In his articles he has the effect you are looking for.

qw3n
I just tore that sites code apart and couldn't even find where he has "Show navigation" in the source, including sub files, so I'm thinking that example probably isn't going to work. Anybody know of any blogs that have covered how to do this effect?
pinnacler
http://www.quirksmode.org/quirksmode.js that is the main javascript file in it search for setMenuOffset. I believe that is the code that does it.
qw3n