Fixed-scrolling div

Soldato
Joined
27 Dec 2005
Posts
17,316
Location
Bristol
I'm looking to replicate something I've seen on a couple of websites.

Basically there'll be a div half-way down the page (or further), which when it reaches the top of the page (when you scroll down) it then sticks and follows you if you go down further.

Can't find anything other than the old position:fixed etc from Googling so if anyone could shed any light that'd be great.
 
That doesn't actually do what I want (and I can't get it to work anyway!).

What I'm thinking of is where there's a div (usually an advert below a side nav menu) that's more than half way down the page off-screen. It scrolls up as normal but once it hits the top of your browser it then 'sticks' and is always at the top (unless you scroll back up and then it sits where it's supposed to again).
 
Back
Top Bottom