luckyb — 2010-06-03T09:54:33-04:00 — #1
Sorry I can't explain this easily with words, so I got some screen captures to help. I want to do something on my site similar to the AdWords help block that sits towards the top of the page but when you scroll down it stays at the top.
Eg, when looking at the top of the page:
Now, I have scrolled down the page, the help section stays "docked" at the top:
I'm wanting to dock a form like this, in the left column, that is contained in a div with id="leadsbox".
luckyb — 2010-06-07T10:06:18-04:00 — #2
siteguru — 2010-06-07T11:53:18-04:00 — #3
I think your search terms are onscroll and scrollTop.
luckyb — 2010-06-03T11:56:49-04:00 — #4
Thanks but does that CSS position fixed work in this scenario? Initially with no scroll the DIV displays about 100 pixels from the top of the top browser edge.
As you scroll down 0-100 pixels the div gets closer to the top of the browser edge (like a normal div would), when you scroll 100+pixels down, then the div stays docked with the very top of the top browser edge. And the reverse happens when you scroll back up.
Makes more sense? Sorry hard to explain
siteguru — 2010-06-03T10:33:55-04:00 — #5
You seem to have omitted the screen captures.
scallioxtx — 2010-06-03T12:11:30-04:00 — #6
Yes that makes sense.
siteguru — 2010-06-03T11:44:25-04:00 — #7
I'm viewing this from the office - I guess the captures are blocked by the firewall. :lol:
scallioxtx — 2010-06-03T11:31:44-04:00 — #8
You can use CSS's position: fixed for this
Note that that doesn't work in IE6, but there are forkarounds for that.
PS. Screen captures are showing for me too
luckyb — 2010-06-03T11:20:26-04:00 — #9
Really? Screen captures are showing for me.
luckyb — 2010-06-04T03:31:00-04:00 — #10