1 reply [Last post]
arghiz's picture
Last seen: 5 years 25 weeks ago
Timezone: GMT+7
Joined: 2012-04-13
Posts: 1
Points: 2

hey i wanna ask, how to make css like ads-sidebar on fb,

when you scroll down, the ads follow you,
but when you scroll to the top of the page, the ads not follow you to the top because of some other div (if you are user of fb, you should know what I mean,)

i think this how to use fixed in relative css-positioning, but i'm failed. its not work,

This is when you go to the top of the page (fb)
when you go to the top of the page (fb)

And this is when you scrolldown
when you scroll down (fb)

can somebody help me Smile

Tyssen's picture
Last seen: 3 years 1 week ago
Timezone: GMT+10
Joined: 2004-05-01
Posts: 8201
Points: 1386

It's not done with CSS alone

It also uses javascript to determine your scroll position. CSS Tricks has some examples.

How to get help
Post a link. If you can't post a link, jsFiddle it.
My blog | My older articles | CSS Reference